forked from ServiceStack/ServiceStack.Text
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnv.cs
More file actions
40 lines (27 loc) · 935 Bytes
/
Env.cs
File metadata and controls
40 lines (27 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
namespace ServiceStack.Text
{
public static class Env
{
static Env()
{
var platform = (int)Environment.OSVersion.Platform;
IsUnix = (platform == 4) || (platform == 6) || (platform == 128);
IsMono = Type.GetType("Mono.Runtime") != null;
IsMonoTouch = Type.GetType("MonoTouch.Foundation.NSObject") != null;
SupportsExpressions = SupportsEmit = !IsMonoTouch;
ServerUserAgent = "ServiceStack/" +
ServiceStackVersion + " "
+ Environment.OSVersion.Platform
+ (IsMono ? "/Mono" : "/.NET")
+ (IsMonoTouch ? " MonoTouch" : "");
}
public static decimal ServiceStackVersion = 3.928m;
public static bool IsUnix { get; set; }
public static bool IsMono { get; set; }
public static bool IsMonoTouch { get; set; }
public static bool SupportsExpressions { get; set; }
public static bool SupportsEmit { get; set; }
public static string ServerUserAgent { get; set; }
}
}