Ejemplo n.º 1
0
 /// <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);
     }
 }
Ejemplo n.º 2
0
        /// <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));
        }
Ejemplo n.º 3
0
        /// <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);
                }
            }
        }
Ejemplo n.º 4
0
 /// <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);
 }