public void Move(double x, double y, double dX, double dY) { switch (MoveStyle) { case EGraphMoveStyle.Graph: IEnumerator enumerator1 = Points.GetEnumerator(); try { while (enumerator1.MoveNext()) { TMarker tmarker = (TMarker)enumerator1.Current; tmarker.X += dX; tmarker.Y += dY; } break; } finally { IDisposable disposable = enumerator1 as IDisposable; if (disposable != null) { disposable.Dispose(); } } case EGraphMoveStyle.Point: IEnumerator enumerator2 = Points.GetEnumerator(); try { while (enumerator2.MoveNext()) { TMarker tmarker = (TMarker)enumerator2.Current; if (tmarker.X == x && tmarker.Y == y) { tmarker.X += dX; tmarker.Y += dY; break; } } break; } finally { IDisposable disposable = enumerator2 as IDisposable; if (disposable != null) { disposable.Dispose(); } } } }
public void Add(TMarker marker) { Points.Add(marker); MinMax(marker.X, marker.Y); }