示例#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;
 }
示例#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
 }
示例#3
0
 public void Remove(IntPair intPair)
 {
     List.Remove(intPair);
 }
示例#4
0
 public void Insert(int index, IntPair intPair)
 {
     List.Insert(index, intPair);
 }
示例#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);
 }
示例#6
0
 public int Add(IntPair intPair)
 {
     return List.Add(intPair);
 }
示例#7
0
 // public methods...
 #region Add
 public int Add(IntPair intPair)
 {
     return(List.Add(intPair));
 }
示例#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);
 }
示例#9
0
 public void Remove(IntPair intPair)
 {
     List.Remove(intPair);
 }
示例#10
0
 public void Insert(int index, IntPair intPair)
 {
     List.Insert(index, intPair);
 }