/// <summary> /// Unions the list with other list of elements /// </summary> /// <param name="list">List to union</param> public void Union(ONList <TKey, TValue> list) { if (list != null) { List.Union(list.List); } }
/// <summary> /// Checks if the list is equal to other list /// </summary> /// <param name="item">List to check if they are the same</param> /// <returns>If the list is equal to other list</returns> public override bool Equals(object item) { ONList <TKey, TValue> lList = item as ONList <TKey, TValue>; if (lList == null) { return(false); } return(List.Equals(lList.List)); }
/// <summary> /// Intersects the list with other list of elements /// </summary> /// <param name="list">List to intersect</param> public void Intersection(ONList <TKey, TValue> list) { ONListDictionary <TKey, TValue> lList = List; mList = new ONListDictionary <TKey, TValue>(); if (list == null) { return; } foreach (ONListDictionaryEntry <TKey, TValue> lEntry in lList) { if (list.Contains(lEntry.Value)) { Add(lEntry.Value); } } }
/// <summary> /// Adds elements to the list from other list /// </summary> /// <param name="list">List where elements have to be added from</param> public void AddRange(ONList <TKey, TValue> list) { List.Union(list.List); }