Пример #1
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            INITreeNode node = treeView1.SelectedNode as INITreeNode;

            textBox2.Text           = node.e.Value;
            textBoxDescription.Text = node.e.Description;
        }
Пример #2
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            INITreeNode node = treeView1.SelectedNode as INITreeNode;

            node.e.Value = textBox2.Text;
            if (node.Parent != null)
            {
                node.Parent.Collapse();
                node.Parent.Expand();
            }
            treeView1.SelectedNode = node;
        }
Пример #3
0
        void treeView1_AfterExpand(object sender, TreeViewEventArgs e)
        {
            INITreeNode node = e.Node as INITreeNode;

            node.Nodes.Clear();
            foreach (INIEntry entry in (INISection)node)
            {
                TreeNode newnode;
                node.Nodes.Add(newnode = new INITreeNode(entry));
                newnode.Nodes.Add("blank");
            }
            //throw new Exception( "The method or operation is not implemented." );
        }
Пример #4
0
 void DeleteTree(TreeNode node)
 {
     if (node != null)
     {
         foreach (TreeNode subnode in node.Nodes)
         {
             DeleteTree(subnode);
         }
         node.Nodes.Clear();
         INITreeNode thisnode = node as INITreeNode;
         //if( thisnode != null && thisnode.e != null )
         //		thisnode.e.Delete();
         if (node.Parent != null)
         {
             node.Parent.Nodes.Remove(node);
         }
         else
         {
             this.treeView1.Nodes.Remove(node);
         }
     }
 }
Пример #5
0
 void PopulateTree()
 {
     treeView1.Nodes.Clear();
     if (map == null)
     {
         map = INI.Default;                // Default;
     }
     if (map == null)
     {
         return;
     }
     foreach (INISection s in map)
     {
         TreeNode node;
         this.treeView1.Nodes.Add(node = new INITreeNode(s));
         foreach (INIEntry e in s)
         {
             this.treeView1.Nodes.Add(node = new INITreeNode(e));
             node.Collapse();
             node.Nodes.Add("blank");
         }
     }
 }