public static void TryRetriveFromConfig(this UserSettings setting) { if (setting == null) { setting = new UserSettings(); } setting.SearchingKeywordsString = TypeParser.GetStringValue(ConfigurationManager.AppSettings[UserSettings.Namespance.SearchingKeyword]); setting.MatchingKeywordsString = TypeParser.GetStringValue(ConfigurationManager.AppSettings[UserSettings.Namespance.MatchingKeyword]); setting.Yijia = TypeParser.GetDouble(ConfigurationManager.AppSettings[UserSettings.Namespance.Yijia]); setting.Rate = TypeParser.GetDouble(ConfigurationManager.AppSettings[UserSettings.Namespance.Rate]); setting.NextPayment = TypeParser.GetInt(ConfigurationManager.AppSettings[UserSettings.Namespance.NextPayment]); setting.FreqTransfer = TypeParser.GetInt32Value(ConfigurationManager.AppSettings[UserSettings.Namespance.FreqTransfer], 60); setting.DelayTransfer = TypeParser.GetInt32Value(ConfigurationManager.AppSettings[UserSettings.Namespance.DelayTransfer]); setting.PageFrom = TypeParser.GetInt32Value(ConfigurationManager.AppSettings[UserSettings.Namespance.PageFrom]); setting.PageTo = TypeParser.GetInt32Value(ConfigurationManager.AppSettings[UserSettings.Namespance.PageTo]); setting.AutoAcquire = TypeParser.GetBoolValue(ConfigurationManager.AppSettings[UserSettings.Namespance.AutoAcquire]); }