Exemple #1
0
        public static void Load(WebsiteSetting websiteSetting)
        {
            WebsiteSetting settings;

            if (websiteSetting.IsDebugMode && websiteSetting.Debug != null)
            {
                settings             = websiteSetting.Debug;
                settings.IsDebugMode = true;
            }
            else
            {
                settings = websiteSetting;
            }

            ApplicationSettingManager.Load(settings);

            _websiteSetting = settings;
            var rountyInfoJson = JsonConvert.SerializeObject(websiteSetting.GoMoblinPortal);

            _goMoblinPortal = JsonConvert.DeserializeObject <GoMoblinPortal>(rountyInfoJson);



            var type       = _goMoblinPortal.GetType();
            var properties = type.GetProperties();

            foreach (var propertyInfo in properties)
            {
                if (propertyInfo.PropertyType == typeof(string))
                {
                    var propValue = propertyInfo.GetValue(_goMoblinPortal);
                    if (propValue == null)
                    {
                        continue;
                    }
                    var propStringVal = propValue.ToString();
                    //propStringVal = propStringVal.Replace("*|affiliateid|*", GoMoblinPortal.AffiliateId.ToString(), StringComparison.CurrentCultureIgnoreCase);
                    //propStringVal = propStringVal.Replace("*|apikey|*", GoMoblinPortal.APIKey, StringComparison.CurrentCultureIgnoreCase);
                    propertyInfo.SetValue(_goMoblinPortal, propStringVal);
                }
            }
            OnSettingChanged();
        }
Exemple #2
0
 internal static void Load(WebsiteSetting websiteSetting)
 {
     _websiteSetting = websiteSetting;
 }
Exemple #3
0
 static WebsiteSettingsManager()
 {
     _websiteSetting = new WebsiteSetting();
 }
Exemple #4
0
        //public static string CellAct => _websiteSetting.GoMoblinPortal.CellAct.BaseUrl;

        static ApplicationSettingManager()
        {
            _websiteSetting = new WebsiteSetting();
        }