Example #1
0
 public void Save()
 {
     //Commit changes and dispose
     if (_editor != null)
     {
         _editor.Commit();
         _editor.Dispose();
         _editor = null;
     }
     if (_preferences != null)
     {
         _preferences.Dispose();
         _preferences = null;
     }
 }
Example #2
0
        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();
 }
Example #4
0
 public void Dispose()
 {
     _editor.Dispose();
 }