Пример #1
0
 public PersistentCollection(string settingName)
 {
     _settingName = settingName;
     if (GetSavedCollection() == null)
     {
         Settings.Default[_settingName] = new List <T>();
         ArgsAndSettings.SaveSettings();
     }
 }
Пример #2
0
        public void Remove(T ele)
        {
            var collection = GetSavedCollection();

            if (collection.Contains(ele))
            {
                var index = collection.IndexOf(ele);
                collection.RemoveAt(index);
                ArgsAndSettings.SaveSettings();
                NotifyRemoved(ele, index);
            }
        }
Пример #3
0
 public Setting(T initialValue, Action <T> setter)
     : base(x => { setter(x); ArgsAndSettings.SaveSettings(); }, initialValue)
 {
 }
Пример #4
0
 public void Add(T ele)
 {
     GetSavedCollection().Add(ele);
     ArgsAndSettings.SaveSettings();
     NotifyAdded(ele);
 }