Exemple #1
0
        protected override void RemoveSide()
        {
            var index = sides.Count - 1;

            if (index > 2)
            {
                var firstSide = sides[index - 1];
                firstSide.UnregisterFromDependencies();
                firstSide.Dependencies[1] = this.Dependencies[1];
                firstSide.RegisterWithDependencies();
            }

            var side = sides[index];

            side.UnregisterFromDependencies();

            sides.RemoveLast();

            var drawing = Drawing;
            var action  = new RemoveFigureAction(drawing, side);

            action.Execute();

            Children.Remove(side);

            if (Drawing != null)
            {
                side.OnRemovingFromCanvas(Drawing.Canvas);
            }
        }
Exemple #2
0
        public static void Remove(IFigure figure)
        {
            var drawing = figure.Drawing;
            RemoveFigureAction action = new RemoveFigureAction(drawing, figure);

            drawing.ActionManager.RecordAction(action);
        }
Exemple #3
0
        protected void RemoveVertex()
        {
            var vertex = vertices[vertices.Count - 1];

            vertex.UnregisterFromDependencies();
            vertices.RemoveLast();

            var drawing = vertex.Drawing;
            var action  = new RemoveFigureAction(drawing, vertex);

            action.Execute();
            Children.Remove(vertex);

            if (Drawing != null)
            {
                vertex.OnRemovingFromCanvas(Drawing.Canvas);
            }
        }