Exemple #1
0
        public virtual void Insert(int index, string key, T item)
        {
            if (_keys.Contains(key))
            {
                throw new Exception("Key already exist");
            }
            _keys.Insert(index, key);
            _items.Insert(index, item);

            if (ItemAdd != null)
            {
                ItemAdd(this, new KeyedCollectionAddEventArgs(_items[index], index, _keys[index]));
            }
            if (CollectionChanged != null)
            {
                CollectionChanged(this, new EventArgs());
            }
        }