public int IndexOf(IntPair intPair)
 {
     for(int i = 0; i < List.Count; i++)
         if (this[i] == intPair)    // Found it
             return i;
     return -1;
 }
 // TODO: If desired, change parameters to Find method to search based on a property of IntPair.
 public IntPair Find(IntPair intPair)
 {
     foreach(IntPair intPairItem in this)
         if (intPairItem == intPair)    // Found it
             return intPairItem;
     return null;    // Not found
 }
 public void Remove(IntPair intPair)
 {
     List.Remove(intPair);
 }
 public void Insert(int index, IntPair intPair)
 {
     List.Insert(index, intPair);
 }
 // TODO: If you changed the parameters to Find (above), change them here as well.
 public bool Contains(IntPair intPair)
 {
     return (Find(intPair) != null);
 }
 public int Add(IntPair intPair)
 {
     return List.Add(intPair);
 }
Exemple #7
0
 // public methods...
 #region Add
 public int Add(IntPair intPair)
 {
     return(List.Add(intPair));
 }
Exemple #8
0
 // TODO: If you changed the parameters to Find (above), change them here as well.
 public bool Contains(IntPair intPair)
 {
     return(Find(intPair) != null);
 }
Exemple #9
0
 public void Remove(IntPair intPair)
 {
     List.Remove(intPair);
 }
Exemple #10
0
 public void Insert(int index, IntPair intPair)
 {
     List.Insert(index, intPair);
 }