public SettingsTracker(ICoreClient client, string applName) { _client = client; _applName = applName; // load current settings _currentSettings = _client.LoadAppSettings(_applName); _unsavedSettings = new NamedValueSet(); }
public void Commit(bool reload) { // save unsaved settings if (_unsavedSettings.Count > 0) { _client.SaveAppSettings(_unsavedSettings, _applName); } // if requested load current settings // (only needed to resync external changes) if (reload) { _currentSettings = _client.LoadAppSettings(_applName); } _unsavedSettings = new NamedValueSet(); }