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