public void DiscardChanges() { // unload the config. _config = null; // re-load. LoadInitialConfig(); // fire. ConfigUpdated?.Invoke(this, EventArgs.Empty); }
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(); } }