예제 #1
0
        public void GetValue_Return()
        {
            ReactConfig.SetValue("test", "testsetvalue");
            var value = ReactConfig.GetValue("test");

            Assert.AreEqual("testsetvalue", value);
        }
예제 #2
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     ReactConfig.Configure();
     BundleConfig.RegisterBundles(BundleTable.Bundles);
 }
        //TODO: Microsoft had not support permanent storage yet,
        //so use our implement instead temp

        private T GetSetting <T>(string key, T defaultValue)
        {
            if (defaultValue is bool)
            {
                var ret = ReactConfig.GetValue(key);
                if (ret != null)
                {
                    if (ret == "true")
                    {
                        Object data = true;
                        return((T)data);
                    }
                    else
                    {
                        Object data = false;
                        return((T)data);
                    }
                }
            }
            else if (defaultValue is string)
            {
                var ret = ReactConfig.GetValue(key);
                if (ret != null)
                {
                    Object data = ret;
                    return((T)data);
                }
            }
            else
            {
                RNTracer.Write(ReactConstants.Tag, "[RN_EXCEPTION]ERROR! ReactNative.DevSupport.DevInternalSettings GetSetting encounter unexpected type, key is " + key);
            }

            return(defaultValue);
        }
        //TODO: Microsoft had not support permanent storage yet,
        //so use our implement instead temp
        private void SetSetting <T>(string key, T value)
        {
            if (value is bool)
            {
                ReactConfig.SetValue(key, value.ToString().ToLower());
            }
            else if (value is string)
            {
                ReactConfig.SetValue(key, value.ToString());
            }
            else
            {
                RNTracer.Write(ReactConstants.Tag, "[RN_EXCEPTION]ERROR! ReactNative.DevSupport.DevInternalSettings GetSetting encounter unexpected type");
                return;
            }

            if (s_triggerReload.Contains(key))
            {
                _debugManager.ReloadSettings();
            }
        }
예제 #5
0
 public void SetValue_Return()
 {
     ReactConfig.SetValue("test", "testsetvalue");
 }