コード例 #1
0
        public void Remove(ObjectExtension value)
        {
            int index = IndexOf(value);

            if (index == -1)
            {
                throw(new Exception("ObjectExtension not found in collection."));
            }
            RemoveAt(index);
        }
コード例 #2
0
 public int IndexOf(ObjectExtension value)
 {
     for (int x = 0; x < itemCount; x++)
     {
         if (extensions[x].Equals(value))
         {
             return(x);
         }
     }
     return(-1);
 }
コード例 #3
0
 public void Insert(int index, ObjectExtension value)
 {
     itemCount++;
     if (itemCount > extensions.Length)
     {
         for (int x = index + 1; x == itemCount - 2; x++)
         {
             extensions[x] = extensions[x - 1];
         }
     }
     extensions[index] = value;
 }
コード例 #4
0
 public int Add(ObjectExtension value)
 {
     itemCount++;
     if (itemCount > extensions.GetUpperBound(0) + 1)
     {
         ObjectExtension[] tempExtensions = new ObjectExtension[itemCount * 2];
         for (int x = 0; x <= extensions.GetUpperBound(0); x++)
         {
             tempExtensions[x] = extensions[x];
         }
         extensions = tempExtensions;
     }
     extensions[itemCount - 1] = value;
     return(itemCount - 1);
 }
コード例 #5
0
 public bool Contains(ObjectExtension value)
 {
     return(IndexOf(value) != -1);
 }