コード例 #1
0
        private FreePoint compareFreePoints(RootFigureList figureList, FreePoint aPoint)
        {
            foreach (IFigure aFigure in figureList)
                if (aFigure is FreePoint && Math.Abs((aFigure as FreePoint).X - aPoint.X)<_delta && Math.Abs((aFigure as FreePoint).Y - aPoint.Y)<_delta)
                    return aFigure as FreePoint;

            return null;
        }
コード例 #2
0
        private FreePoint compareFreePoints(RootFigureList figureList, FreePoint aPoint)
        {
            foreach (IFigure aFigure in figureList)
            {
                if (aFigure is FreePoint && Math.Abs((aFigure as FreePoint).X - aPoint.X) < _delta && Math.Abs((aFigure as FreePoint).Y - aPoint.Y) < _delta)
                {
                    return(aFigure as FreePoint);
                }
            }

            return(null);
        }
コード例 #3
0
ファイル: Drawing.cs プロジェクト: ondrej11/o106
        public Drawing(Canvas canvas)
        {
            Check.NotNull(canvas, "canvas");

            ActionManager = new ActionManager();
            StyleManager = new StyleManager(this);

            Figures = new RootFigureList(this);

            OnAttachToCanvas += Drawing_OnAttachToCanvas;
            OnDetachFromCanvas += Drawing_OnDetachFromCanvas;

            Canvas = canvas;

            CoordinateSystem = new CoordinateSystem(this);
            CoordinateGrid = new CartesianGrid() { Drawing = this, Visible = Settings.Instance.ShowGrid };
            Figures.Add(CoordinateGrid);
            Version = Settings.CurrentDrawingVersion;
        }
コード例 #4
0
ファイル: Drawing.cs プロジェクト: radtek/Shopdrawing
        public Drawing(Canvas canvas)
        {
            Check.NotNull(canvas, "canvas");

            ActionManager = new ActionManager();
            StyleManager  = new StyleManager(this);

            Figures = new RootFigureList(this);

            OnAttachToCanvas   += Drawing_OnAttachToCanvas;
            OnDetachFromCanvas += Drawing_OnDetachFromCanvas;

            Canvas = canvas;

            CoordinateSystem = new CoordinateSystem(this);
            CoordinateGrid   = new CartesianGrid()
            {
                Drawing = this, Visible = Settings.Instance.ShowGrid
            };
            Figures.Add(CoordinateGrid);
            Version = Settings.CurrentDrawingVersion;
        }