Inheritance: IDrawable, IMovable
Exemple #1
0
        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();
                    }
                }
            }
        }
Exemple #2
0
 public void Add(TMarker marker)
 {
     Points.Add(marker);
     MinMax(marker.X, marker.Y);
 }
Exemple #3
0
 public void Add(TMarker marker)
 {
     Points.Add(marker);
     MinMax(marker.X, marker.Y);
 }