Ejemplo n.º 1
0
        public bool RemoveAll(FoundationBag <T> bag)
        {
            if (bag == null || bag.Count == 0)
            {
                return(false);
            }

            lock (SyncObject) {
                bool modified = false;
                for (int i = 0, count = bag.Count; i < count; i++)
                {
                    Object o1 = bag.Get(i);
                    for (int j = 0; j < Count; j++)
                    {
                        Object o2 = Items [j];
                        if (o1 == o2)
                        {
                            Remove(j);
                            j--;
                            modified = true;
                            break;
                        }
                    }
                }
                return(modified);
            }
        }
Ejemplo n.º 2
0
 public void AddAll(FoundationBag <T> bag)
 {
     lock (SyncObject) {
         for (int i = 0, count = bag.Count; i < count; i++)
         {
             Add(bag.Get(i));
         }
     }
 }