Ejemplo n.º 1
0
        private static void Load()
        {
            if (!File.Exists(configPath))
            {
                File.Create(configPath).Close();
            }
            string json = File.ReadAllText(configPath);

            if (!string.IsNullOrEmpty(json))
            {
                try
                {
                    storage = JsonConvert.DeserializeObject <CommonStorage>(json);
                }
                catch (Exception e)
                {
                    LoadDefaultUserSetting();
                }
            }
            else
            {
                LoadDefaultUserSetting();
            }
        }
Ejemplo n.º 2
0
 private static void Load()
 {
     if (!File.Exists(configPath))
     {
         File.Create(configPath).Close();
     }
     string json = File.ReadAllText(configPath);
     if (!string.IsNullOrEmpty(json))
     {
         try
         {
             storage = JsonConvert.DeserializeObject<CommonStorage>(json);
         }
         catch (Exception e)
         {
             LoadDefaultUserSetting();
         }
     }
     else
     {
         LoadDefaultUserSetting();
     }
 }