public static void Load() { using (var sr = new StreamReader(_file)) { Config = JsonConvert.DeserializeObject<Settings>(sr.ReadToEnd()); } }
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)); }
static Settings() { _file = "settings.json"; if (!File.Exists(_file)) { Config = new Settings { ShowPasswords = true, SelectedRegion = Region.NA }; Save(); return; } Load(); }