AddElement() public method

public AddElement ( BaseElement el ) : void
el BaseElement
return void
示例#1
0
        private void EndAddElement(Rectangle selectionRectangle)
        {
            BaseElement el;

            switch (document.ElementType)
            {
            case ElementType.Rectangle:
                el = new RectangleElement(selectionRectangle);
                break;

            case ElementType.RectangleNode:
                el = new RectangleNode(selectionRectangle);
                break;

            case ElementType.Elipse:
                el = new ElipseElement(selectionRectangle);
                break;

            case ElementType.ElipseNode:
                el = new ElipseNode(selectionRectangle);
                break;

            case ElementType.CommentBox:
                el = new CommentBoxElement(selectionRectangle);
                break;

            default:
                el = new RectangleNode(selectionRectangle);
                break;
            }

            document.AddElement(el);

            document.Action = DesignerAction.Select;
        }
示例#2
0
        private void EndAddElement(Rectangle selectionRectangle)
        {
            var el = CreateElementInstance(selectionRectangle);

            Document.AddElement(el);

            Document.Action = DesignerAction.Select;
        }