Beispiel #1
0
        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" : "");
        }
Beispiel #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();
 }
        internal void AssertValidUsage()
        {
            if (!IsUserType)
            {
                return;
            }

            LicenseUtils.AssertValidUsage(LicenseFeature.Text, QuotaType.Types, JsConfig.__uniqueTypesCount);
        }
        internal void AssertValidUsage()
        {
            if (!IsUserType)
            {
                return;
            }

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