protected void CreateComment()
 {
     var figure = new CommentFigure (String.Empty);
     figure.MoveTo (PointerToDrawing.X, PointerToDrawing.Y);
     View.Add (figure);
 }
        public void Deserialize(XElement xml, ProjectDom dom)
        {
            DeserializeGrouping (xml.Attribute ("Grouping"));
            DeserializeMembersFormat (xml.Attribute ("MembersFormat"));

            foreach (var element in xml.Elements ()) {
                switch (element.Name.LocalName) {
                    case "Class":
                    case "Struct":
                    case "Enum":
                    case "Interface":
                    case "Delegate":
                        DeserializeType (element, dom);
                        break;
                    case "Comment":
                        var comment = new CommentFigure ();
                        comment.Deserialize (element, dom);
                        Add (comment);
                        break;
                    case "Font":
                        DeserializeFont (element);
                        break;
                    default:
                        throw new DeserializationException ("Unknown XML element: " + element.Name);
                }
            }
        }
        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 ();
        }