There's a few ways that you could do this programmatically, but the easiest way is to let the server determine this for you: if you perform a get latest with the preview get option set, it will not actually perform the get, it will simply tell you what would be retrieved to bring you up to the latest version.
For example:
GetStatus status = workspace.Get(new GetRequest(null, VersionSpec.Latest), GetOptions.Preview);
if(status.NumOperations == 0)
{
/* All files up to date. */
}
else
{
/* We are not up to date on some files. */
}