Beispiel #1
0
 public void Load()
 {
     if (File.Exists(Main.AppSettingsSavePath))
     {
         JsonParser jsonString = JsonParser.Deserialize(File.ReadAllText(Main.AppSettingsSavePath));
         Main.AppSettings           = jsonString.Value.ToObject <SettingsStore>();
         Main.Filters               = string.IsNullOrEmpty(Main.AppSettings.DefaultFilterList) ? Main.Filters : JsonParser.Deserialize(Main.AppSettings.DefaultFilterList).Value.ToObject <List <Filter> >();
         Main.AppSettings.IsDefault = false;
     }
     else
     {
         Main.AppSettings.InputLocation     = $@"{Environment.GetFolderPath(Environment.SpecialFolder.Desktop)}\CSVs";
         Main.AppSettings.OutputLocation    = $@"{Environment.GetFolderPath(Environment.SpecialFolder.Desktop)}\CSVs\FilterOutputs";
         Main.AppSettings.DefaultInputType  = Filter.InputType.Numeric;
         Main.AppSettings.DefaultType       = (Filter.Type) 2;
         Main.AppSettings.DefaultFilterList = "";
         Main.AppSettings.IsDefault         = true;
     }
 }