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