To understand whether the role instance is running in the Windows Azure compute emulator, you simply need to check this static variable:
RoleEnvironment.IsEmulated
Namespace: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)