예제 #1
0
        public bool Add(T key)
        {
            bool added = _items.Add(key);

            if (added)
            {
                AfterKeyAdded?.Invoke(this, new KeyEventArg <T>(key));
            }
            return(added);
        }
예제 #2
0
 public TI this[TK key]
 {
     get
     {
         return(_items[key]);
     }
     set
     {
         if (!_items.ContainsKey(key) && !_items.ContainsValue((T)value))
         {
             _items[key]            = (T)value;
             value.PropertyChanged += Value_PropertyChanged;
             AfterKeyAdded?.Invoke(this, new KeyEventArg <TK>(key));
         }
     }
 }