protected void CreateComment() { var figure = new CommentFigure (String.Empty); figure.MoveTo (PointerToDrawing.X, PointerToDrawing.Y); View.Add (figure); }
public override void ConsumeItem(ItemToolboxNode item) { var figureItem = item as IToolboxFigure; var connectorItem = item as IToolboxConnector; if (connectorItem == null && figureItem == null) return; if (connectorItem != null) { // AbstractConnectionFigure connector; // // if (connectorItem.ConnectorType == ConnectionType.Inheritance) // connector = new InheritanceConnectionFigure (); // else // connector = new AssociationConnectionFigure (connectorItem.ConnectorType); // // Tool = new ConnectionCreationTool (this, connector.ConnectionLine); return; } int x, y; Control.GetPointer (out x, out y); var point = View.ViewToDrawing (x, y); if (figureItem.ClassType == ClassType.Unknown) { var comment = new CommentFigure (String.Empty); comment.MoveTo (point.X, point.Y); View.Add (comment); return; } var dialog = new AddFigureDialog (figureItem.Name, figureItem.ClassType, point, this); dialog.ShowAll (); }