Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public static string GetSettings(TypeSettings typeSettings)
 {
     /*if (CrossSettings.IsSupported)
      *  return CrossSettings.Current.GetValueOrDefault(typeSettings.ToString(), string.Empty);
      * else
      *  return "";*/
     return(GetSettings(typeSettings.ToString()));
 }
Ejemplo n.º 4
0
 public static void SetSettings(TypeSettings typeSettings, DateTime value)
 {
     CrossSettings.Current.AddOrUpdateValue(typeSettings.ToString(), value.ToString());
 }
Ejemplo n.º 5
0
 public static void SetSettings(TypeSettings typeSettings, string value)
 {
     //CrossSettings.Current.AddOrUpdateValue(typeSettings.ToString(), value);
     SetSettings(typeSettings.ToString(), value);
 }