Beispiel #1
0
 public int IndexOf(IntPair intPair)
 {
     for(int i = 0; i < List.Count; i++)
         if (this[i] == intPair)    // Found it
             return i;
     return -1;
 }
Beispiel #2
0
 // 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
 }
Beispiel #3
0
 public void Remove(IntPair intPair)
 {
     List.Remove(intPair);
 }
Beispiel #4
0
 public void Insert(int index, IntPair intPair)
 {
     List.Insert(index, intPair);
 }
Beispiel #5
0
 // TODO: If you changed the parameters to Find (above), change them here as well.
 public bool Contains(IntPair intPair)
 {
     return (Find(intPair) != null);
 }
Beispiel #6
0
 public int Add(IntPair intPair)
 {
     return List.Add(intPair);
 }
Beispiel #7
0
 // public methods...
 #region Add
 public int Add(IntPair intPair)
 {
     return(List.Add(intPair));
 }
Beispiel #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);
 }
Beispiel #9
0
 public void Remove(IntPair intPair)
 {
     List.Remove(intPair);
 }
Beispiel #10
0
 public void Insert(int index, IntPair intPair)
 {
     List.Insert(index, intPair);
 }