public override void Add(BaseElement element) { Pair pairNew = element as Pair; // check existsing item and remove it foreach (Pair item in Items) { if (item.Key == pairNew.Key) { Items.Remove(item); break; } } // add Items.Add(pairNew); }
// Methods public abstract void Add(BaseElement element);