コード例 #1
0
ファイル: Env.cs プロジェクト: mailrameshs/ServiceStack.Text
        static Env()
        {
            LicenseUtils.AssertEvaluationLicense();

            string platformName = null;

#if NETFX_CORE
            platformName = "WinRT";
#else
            var platform = (int)Environment.OSVersion.Platform;
            IsUnix       = (platform == 4) || (platform == 6) || (platform == 128);
            platformName = Environment.OSVersion.Platform.ToString();
#endif

            IsMono = AssemblyUtils.FindType("Mono.Runtime") != null;

            IsMonoTouch = AssemblyUtils.FindType("MonoTouch.Foundation.NSObject") != null;

            IsWinRT = AssemblyUtils.FindType("Windows.ApplicationModel") != null;

            SupportsExpressions = SupportsEmit = !IsMonoTouch;

            ServerUserAgent = "ServiceStack/" +
                              ServiceStackVersion + " "
                              + platformName
                              + (IsMono ? "/Mono" : "/.NET")
                              + (IsMonoTouch ? " MonoTouch" : "")
                              + (IsWinRT ? ".NET WinRT" : "");
        }
コード例 #2
0
 static JsConfig()
 {
     //In-built default serialization, to Deserialize Color struct do:
     //JsConfig<System.Drawing.Color>.SerializeFn = c => c.ToString().Replace("Color ", "").Replace("[", "").Replace("]", "");
     //JsConfig<System.Drawing.Color>.DeSerializeFn = System.Drawing.Color.FromName;
     Reset();
     LicenseUtils.Init();
 }
コード例 #3
0
        internal void AssertValidUsage()
        {
            if (!IsUserType)
            {
                return;
            }

            LicenseUtils.AssertValidUsage(LicenseFeature.Text, QuotaType.Types, JsConfig.__uniqueTypesCount);
        }
コード例 #4
0
        internal void AssertValidUsage()
        {
            if (!IsUserType)
            {
                return;
            }

#if  USE_LICENSE_UTILS
            LicenseUtils.AssertValidUsage(LicenseFeature.Text, QuotaType.Types, JsConfig.__uniqueTypes.Count);
#endif
        }
コード例 #5
0
 static JsConfig()
 {
     Reset();
     LicenseUtils.Init();
 }