Пример #1
0
        public void DiscardChanges()
        {
            // unload the config.
            _config = null;

            // re-load.
            LoadInitialConfig();

            // fire.
            ConfigUpdated?.Invoke(this, EventArgs.Empty);
        }
Пример #2
0
 private void LoadInitialConfig()
 {
     if (_fs.FileExists("/redteam.json"))
     {
         var json = _fs.ReadAllText("/redteam.json");
         _config = JsonSerializer.Deserialize <RedConfig>(json, new JsonSerializerOptions
         {
             IncludeFields = true
         });
     }
     else
     {
         _config = new RedConfig();
         SaveConfig();
     }
 }