This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,25 @@ static Env()
14
14
throw new ArgumentException ( "PclExport.Instance needs to be initialized" ) ;
15
15
16
16
var platformName = PclExport . Instance . PlatformName ;
17
+ if ( platformName != "WindowsStore" )
18
+ {
19
+ IsMono = AssemblyUtils . FindType ( "Mono.Runtime" ) != null ;
17
20
18
- IsMono = AssemblyUtils . FindType ( "Mono.Runtime" ) != null ;
19
-
20
- IsMonoTouch = AssemblyUtils . FindType ( "MonoTouch.Foundation.NSObject" ) != null ;
21
+ IsMonoTouch = AssemblyUtils . FindType ( "MonoTouch.Foundation.NSObject" ) != null ;
21
22
22
- IsAndroid = AssemblyUtils . FindType ( "Android.Manifest" ) != null ;
23
+ IsAndroid = AssemblyUtils . FindType ( "Android.Manifest" ) != null ;
23
24
24
- IsWinRT = AssemblyUtils . FindType ( "Windows.ApplicationModel" ) != null ;
25
+ //Throws unhandled exception if not called from the main thread
26
+ //IsWinRT = AssemblyUtils.FindType("Windows.ApplicationModel") != null;
25
27
26
- IsWindowsPhone = AssemblyUtils . FindType ( "Microsoft.Phone.Info.DeviceStatus" ) != null ;
28
+ IsWindowsPhone = AssemblyUtils . FindType ( "Microsoft.Phone.Info.DeviceStatus" ) != null ;
27
29
28
- IsSilverlight = AssemblyUtils . FindType ( "System.Windows.Interop.SilverlightHost" ) != null ;
30
+ IsSilverlight = AssemblyUtils . FindType ( "System.Windows.Interop.SilverlightHost" ) != null ;
31
+ }
32
+ else
33
+ {
34
+ IsWinRT = true ;
35
+ }
29
36
30
37
#if PCL
31
38
IsUnix = IsMono ;
Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ namespace ServiceStack
20
20
{
21
21
public abstract class PclExport
22
22
{
23
+ public const string WindowsStore = "WindowsStore" ;
24
+ public const string Android = "Android" ;
25
+ public const string IOS = "IOS" ;
26
+ public const string WindowsStore = "WindowsStore" ;
27
+ public const string Silverlight5 = "Silverlight5" ;
28
+
23
29
public static PclExport Instance
24
30
#if PCL
25
31
/*attempts to be inferred otherwise needs to be set explicitly by host project*/
You can’t perform that action at this time.
0 commit comments