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); }
// public methods... #region Add public int Add(IntPair intPair) { return(List.Add(intPair)); }
// TODO: If you changed the parameters to Find (above), change them here as well. public bool Contains(IntPair intPair) { return(Find(intPair) != null); }