Example #1
0
 public static void Load()
 {
     using (var sr = new StreamReader(_file))
     {
         Config = JsonConvert.DeserializeObject<Settings>(sr.ReadToEnd());
     }
 }
Example #2
0
 static Settings()
 {
     if (!System.IO.File.Exists(File))
     {
         Config = new Settings
         {
             ShowPasswords = true,
             SelectedRegion = Region.NA
         };
         Save();
         return;
     }
     Load();
     TaskFactory = new TaskFactory(new LimitedConcurrencyLevelTaskScheduler(Environment.ProcessorCount));
 }
Example #3
0
        static Settings()
        {
            _file = "settings.json";

            if (!File.Exists(_file))
            {
                Config = new Settings
                {
                    ShowPasswords = true,
                    SelectedRegion = Region.NA
                };
                Save();
                return;
            }

            Load();
        }