static Env()
{
if (PclExport.Instance == null)
throw new ArgumentException("PclExport.Instance needs to be initialized");
var platformName = PclExport.Instance.PlatformName;
if (platformName != PclExport.Platforms.WindowsStore)
{
IsMono = AssemblyUtils.FindType("Mono.Runtime") != null;
IsMonoTouch = AssemblyUtils.FindType("MonoTouch.Foundation.NSObject") != null
|| AssemblyUtils.FindType("Foundation.NSObject") != null;
IsAndroid = AssemblyUtils.FindType("Android.Manifest") != null;
//Throws unhandled exception if not called from the main thread
//IsWinRT = AssemblyUtils.FindType("Windows.ApplicationModel") != null;
IsWindowsPhone = AssemblyUtils.FindType("Microsoft.Phone.Info.DeviceStatus") != null;
IsSilverlight = AssemblyUtils.FindType("System.Windows.Interop.SilverlightHost") != null;
}
else
{
IsWindowsStore = true;
}
#if PCL || NETSTANDARD1_1
IsUnix = IsMono;
#else
var platform = (int)Environment.OSVersion.Platform;
IsUnix = (platform == 4) || (platform == 6) || (platform == 128);
#endif
ServerUserAgent = "ServiceStack/" +
ServiceStackVersion + " "
+ platformName
+ (IsMono ? "/Mono" : "/.NET");
VersionString = ServiceStackVersion.ToString(CultureInfo.InvariantCulture);
__releaseDate = new DateTime(2001,01,01);
}