//using Nest; using System.Collections.Generic; namespace EventLogApp { internal class EventElementsDictionary : Dictionary where T : CodeNameType { //private Dictionary dictionary = new Dictionary(); public EventElementsDictionary() : base() { } EventElementsDictionary(int capacity) : base(capacity) { } public void Add(T item) { if (typeof(T).IsSubclassOf(typeof(CodeNameGuidType))) { if (base.ContainsKey(item.Code)) { base.Remove(item.Code); } } base.Add(item.Code, item); } } }