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; }
private void EndAddElement(Rectangle selectionRectangle) { var el = CreateElementInstance(selectionRectangle); Document.AddElement(el); Document.Action = DesignerAction.Select; }