コード例 #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);
 }