Example #1
0
        public void Remove(ExposedManager value)
        {
            OnCollectionChanged(EventArgs.Empty);
            int index = IndexOf(value);

            if (index == -1)
            {
                throw(new Exception("ExposedManager not found in collection."));
            }
            RemoveAt(index);
        }
Example #2
0
 public int IndexOf(ExposedManager value)
 {
     lock (this)
     {
         for (int x = 0; x < count; x++)
         {
             if (managers[x].Equals(value))
             {
                 return(x);
             }
         }
         return(-1);
     }
 }
Example #3
0
 public int Add(ExposedManager value)
 {
     OnCollectionChanged(EventArgs.Empty);
     lock (this)
     {
         count++;
         // Resize the array if the count is greater than the length
         // of the array.
         if (count > managers.GetUpperBound(0) + 1)
         {
             ExposedManager[] temps = new ExposedManager[count * 2];
             Array.Copy(managers, temps, count - 1);
             managers = temps;
         }
         managers[count - 1] = value;
     }
     return(count - 1);
 }
Example #4
0
 public void Insert(int index, ExposedManager value)
 {
     OnCollectionChanged(EventArgs.Empty);
     lock (this)
     {
         count++;
         // Resize the array if the count is greater than the length
         // of the array.
         if (count > managers.GetUpperBound(0) + 1)
         {
             ExposedManager[] temps = new ExposedManager[count * 2];
             Array.Copy(managers, temps, count - 1);
             managers = temps;
         }
         for (int x = index + 1; x == count - 2; x++)
         {
             managers[x] = managers[x - 1];
         }
         managers[index] = value;
     }
 }
Example #5
0
 public bool Contains(ExposedManager value)
 {
     return(IndexOf(value) != -1);
 }