예제 #1
0
        private static void renameItem_Click(object sender, EventArgs e)
        {
            ToolStripItem menuItem = (ToolStripItem)sender;
            DiagramNode   node     = (DiagramNode)menuItem.Owner.Tag;

            node.EditLabel();
        }
예제 #2
0
        private void AddProjectItemNode(IProjectItem projectItem)
        {
            ModelNode node = null;

            if (projectItem is Diagram)
            {
                Diagram diagram = (Diagram)projectItem;
                node = new DiagramNode(diagram);
                if (TreeView != null)
                {
                    ModelView.OnDocumentOpening(new DocumentEventArgs(diagram));
                }
            }
            // More kind of items might be possible later...

            if (node != null)
            {
                Nodes.Add(node);
                if (TreeView != null)
                {
                    node.AfterInitialized();
                    TreeView.SelectedNode = node;
                }
                if (projectItem.IsUntitled)
                {
                    node.EditLabel();
                }
            }
        }
예제 #3
0
        private static void open_Click(object sender, EventArgs e)
        {
            ToolStripItem menuItem  = (ToolStripItem)sender;
            ModelView     modelView = (ModelView)((ContextMenuStrip)menuItem.Owner).SourceControl;
            DiagramNode   node      = (DiagramNode)menuItem.Owner.Tag;

            modelView.OnDocumentOpening(new DocumentEventArgs(node.Diagram));
        }