Beispiel #1
0
        private void addObjectNode(TreeNode parent, IObjectLabel label)
        {
            if (tree == null)
            {
                return;
            }
            NamedNode node = new NamedNode(label, false);

            if (label is IObjectLabelUI)
            {
                IObjectLabelUI lab = label as IObjectLabelUI;
                lab.Node = node;
            }
            parent.Nodes.Add(node);
            if (!(label.Object is IObjectContainer))
            {
                return;
            }
            IObjectContainer            cont = label.Object as IObjectContainer;
            IDesktop                    desk = cont.Desktop;
            Dictionary <string, object> t    = cont.Interface;

            foreach (string str in t.Keys)
            {
                INamedComponent comp = desk[str];
                NamedNode       n    = new NamedNode(comp, false);
                node.Nodes.Add(n);
            }
        }
Beispiel #2
0
 /// <summary>
 /// Select event handler
 /// </summary>
 /// <param name="sender">The sender</param>
 /// <param name="e">The event arguments</param>
 private void selectTree(object sender, System.Windows.Forms.TreeViewEventArgs e)
 {
     if (!(e.Node is NamedNode))
     {
         return;
     }
     NamedNode node = e.Node as NamedNode;
 }
Beispiel #3
0
        /// <summary>
        /// Edit tree node event handler
        /// </summary>
        /// <param name="sender">The sender</param>
        /// <param name="e">The event arguments</param>
        private void editNode(object sender, System.Windows.Forms.NodeLabelEditEventArgs e)
        {
            string name = e.Label;

            if (!(e.Node is NamedNode))
            {
                return;
            }
            NamedNode node = e.Node as NamedNode;

            node.SetName(name);
        }
Beispiel #4
0
        /// <summary>
        /// Tree mouse up event handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Right)
            {
                return;
            }
            TreeNode n = tree.SelectedNode;

            if (!(n is NamedNode))
            {
                return;
            }
            NamedNode node = n as NamedNode;

            node.ShowForm();
        }
Beispiel #5
0
        /// <summary>
        /// Adds arrow node
        /// </summary>
        /// <param name="label"></param>
        public void AddArrowNode(IArrowLabelUI label)
        {
            if (tree == null)
            {
                return;
            }
            NamedNode node = new NamedNode(label, false);

            label.Node = node;
            arrowsNode.Nodes.Add(node);
            NamedNode ns = new NamedNode(label.Source, true);

            node.Nodes.Add(ns);
            NamedNode nt = new NamedNode(label.Target, true);

            node.Nodes.Add(nt);
        }