Exemplo n.º 1
0
        // для одного node из ICollection
        public void prepare_node_in_collection(ISemanticNode subnode, string node_name, myTreeNode tn_parent, bool is_leaf)
        {
            myTreeNode t;
            if (treeView.SelectedNode == null)
                t = null;
            else
                if (treeView.SelectedNode.Tag == null)
                    t = null;
                else
                    t = treeView.SelectedNode as myTreeNode;

            if (subnode != null)
            {
                myTreeNode tn = new myTreeNode();

                tn.Text = node_name + "   :   " + subnode.GetType().Name;
                tn.Tag = subnode;
                SematicTreeVisitor vs = new SematicTreeVisitor(tn.Nodes);

                tn_parent.Nodes.Add(tn);

                try
                {
                    if (!table_subnodes.ContainsKey(subnode))
                        table_subnodes.Add(subnode, tn);
                }
                catch (System.Exception e)
                {
                    MessageBox.Show("Exception was \n" + e.ToString());
                }

                //treeView.Invalidate();
                //(tn as myTreeNode).is_leaf = is_leaf;
            }
        }
Exemplo n.º 2
0
        public void prepare_node_in_collection_up_link(ISemanticNode subnode, string node_name, myTreeNode tn_parent)
        {
            myTreeNode t;
            if (treeView.SelectedNode == null)
                t = null;
            else
                if (treeView.SelectedNode.Tag == null)
                    t = null;
                else
                    t = treeView.SelectedNode as myTreeNode;


            if (subnode != null)
            {
                myTreeNode tn = new myTreeNode();

                tn.Tag = subnode;
                tn.BackColor = System.Drawing.Color.Yellow;
                tn.Text = node_name + "   :   " + subnode.GetType().Name;
                tn.is_leaf = true;
                tn_parent.Nodes.Add(tn);

                try
                {
                    if (!table_up_rows.ContainsKey(tn) && tn != null)
                        table_up_rows.Add(tn, subnode);
                }
                catch (System.Exception e)
                {
                    MessageBox.Show("Exception was \n" + e.ToString());
                }
            }
        }
Exemplo n.º 3
0
        //--------------------------------------------------------------------------------------------
        //--------------------------------------------------------------------------------------------
        //--------------------------------------------------------------------------------------------
        //--------------------------------------------------------------------------------------------
        //--------------------------------------------------------------------------------------------


        // для обычного node - потомка ISemanticNode
        public void prepare_node(ISemanticNode subnode, string node_name)
        {
            myTreeNode t;
            if (treeView.SelectedNode == null)
                t = null;
            else
                if (treeView.SelectedNode.Tag == null)
                    t = null;
                else
                    t = treeView.SelectedNode as myTreeNode;


            if (subnode != null)
            {
                myTreeNode tn = new myTreeNode();

                tn.Text = node_name + "   :   " + subnode.GetType().Name;
                tn.Tag = subnode;
                SematicTreeVisitor vs = new SematicTreeVisitor(tn.Nodes);
                
                if (t != null)
                    t.Nodes.Add(tn);
                else
                    nodes.Add(tn);

                try
                {
                    if (!table_subnodes.ContainsKey(subnode))
                        table_subnodes.Add(subnode, tn);
                }
                catch (System.Exception e)
                {
                    MessageBox.Show("Exception was \n" + e.ToString());
                }
            }
        }
Exemplo n.º 4
0
 public void visit(ISemanticNode value)
 {
     throw new System.NotSupportedException(value.GetType().ToString());
 }