public bool Remove(ValuePair <T> item) { if (!Contains(item)) { return(false); } return(Remove(item.Identity)); }
public void CopyTo(ValuePair <T>[] array, int arrayIndex) { var o = List.Skip(arrayIndex).ToArray(); for (int i = 0; i < array.Length; i++) { array[i] = new ValuePair <T>(o[i].Identity, o[i].Value); } }
public bool MoveNext() { _index++; if (_index >= _list.Count) { return(false); } _current = new ValuePair <T>(_list[_index].Identity, _list[_index].Value); return(true); }
public bool Contains(ValuePair <T> item) { if (!ContainsKey(item.Identity)) { return(false); } if (!this[item.Identity].Equals(item.Value)) { return(false); } return(true); }
public void Add(ValuePair <T> item) { if (!ContainsKey(item.Identity)) { List.Add(new ValuePair <T>(item.Identity, item.Value)); } else { if (typeof(T).IsSubclassOf(typeof(IList))) { foreach (var g in (IList)item.Value) { ((IList)this[item.Identity]).Add(g); } } else { throw new ArgumentOutOfRangeException($"Already contains identity: \"{item.Identity}\""); } } }
public void Reset() { _index = -1; _current = default; }