public void Add(object header) { //var p=new KeyValuePairEx<object,int>(header,1) var pair = new KeyValuePairEx <object, int>(header, 1); HeaderTextList.Add(pair); }
public void Remove(object header) { var index = HeaderTextList.IndexOf(x => x.Value.SafeEquals(header)); if (index < 0) { return; } HeaderTextList.RemoveAt(index); }
public void Decrement(object header) { var pair = HeaderTextList.FirstOrDefault(x => x.Key.SafeEquals(header)); if (pair == null) { throw new System.ArgumentOutOfRangeException("header"); } else { pair.Value -= 1; } }
public void Increment(object header) { var pair = HeaderTextList.FirstOrDefault(x => x.Key.SafeEquals(header)); if (pair == null) { Add(header); } else { pair.Value += 1; } }
public bool ContainsKey(object header) { return(HeaderTextList.Any(x => x.Key.SafeEquals(header))); }