public static void LoadValues() { InitAppLang(); if (Preferences.ContainsKey(SettingConstants.RF_END_TIME)) { string endTimeP = Preferences.Get(SettingConstants.RF_END_TIME, ""); if (!DateTime.TryParse(endTimeP, DTCulture, System.Globalization.DateTimeStyles.None, out EndTime)) { EndTime = DateTime.Now; } } else { DateTime now = DateTime.Now; Preferences.Set(SettingConstants.RF_END_TIME, now.ToString(DTCulture)); EndTime = now; } LastInputTime = Preferences.Get(SettingConstants.RF_LAST_INPUT_TIME, DateTime.Now.ToString(DTCulture)); Bounty = Preferences.Get(SettingConstants.RF_COUNT, 0); AddCount = Preferences.Get(SettingConstants.RF_ADD_COUNT, 0); RealmEnv.LoadValues(); }
public static void SaveValue() { try { Preferences.Set(SettingConstants.RF_COUNT, Bounty); Preferences.Set(SettingConstants.RF_ADD_COUNT, AddCount); Preferences.Set(SettingConstants.RF_END_TIME, EndTime.ToString(DTCulture)); Preferences.Set(SettingConstants.RF_LAST_INPUT_TIME, LastInputTime); RealmEnv.SaveValues(); } catch { } }