public static bool GetSettingsBool(TypeSettings typeSettings) { string temp = ""; if (CrossSettings.IsSupported) { temp = CrossSettings.Current.GetValueOrDefault(typeSettings.ToString(), string.Empty); } // Par défaut : false if (string.IsNullOrEmpty(temp)) { return(false); } bool ret = false; try { ret = bool.Parse(temp); } catch { } return(ret); }
public static DateTime GetSettingsDate(TypeSettings typeSettings) { string temp = ""; if (CrossSettings.IsSupported) { temp = CrossSettings.Current.GetValueOrDefault(typeSettings.ToString(), string.Empty); } // Par défaut : minval if (string.IsNullOrEmpty(temp)) { return(DateTime.MinValue); } DateTime ret = DateTime.MinValue; try { ret = DateTime.Parse(temp); } catch { } return(ret); }
public static string GetSettings(TypeSettings typeSettings) { /*if (CrossSettings.IsSupported) * return CrossSettings.Current.GetValueOrDefault(typeSettings.ToString(), string.Empty); * else * return "";*/ return(GetSettings(typeSettings.ToString())); }
public static void SetSettings(TypeSettings typeSettings, DateTime value) { CrossSettings.Current.AddOrUpdateValue(typeSettings.ToString(), value.ToString()); }
public static void SetSettings(TypeSettings typeSettings, string value) { //CrossSettings.Current.AddOrUpdateValue(typeSettings.ToString(), value); SetSettings(typeSettings.ToString(), value); }