public void Save() { //Commit changes and dispose if (_editor != null) { _editor.Commit(); _editor.Dispose(); _editor = null; } if (_preferences != null) { _preferences.Dispose(); _preferences = null; } }
protected override void PutInt(string key, int value) { ISharedPreferencesEditor preferencesEditor = null; if (String.IsNullOrEmpty(key)) { throw new ArgumentNullException(nameof(key)); } if (this.sharedPreferences != null) { preferencesEditor = this.sharedPreferences.Edit(); preferencesEditor.PutInt(key, value); preferencesEditor.Commit(); preferencesEditor.Dispose(); preferencesEditor = null; } }
public void Dispose() { _pref?.Dispose(); _editor?.Dispose(); }
public void Dispose() { _editor.Dispose(); }