Esempio n. 1
0
 public void RemoveTreeNodeElement(TreeNodeElement elementNode)
 {
     foreach (ControlTreeNode node in Nodes)
     {
         if (node.Name == "Elements")
         {
             node.Nodes.Remove(elementNode);
         }
     }
 }
Esempio n. 2
0
        private void Configurate()
        {
            ControlTreeNode   elementsNode = new ControlTreeNode("Elements");
            ContextMenuStrip  menuStripBox = new ContextMenuStrip();
            ToolStripMenuItem addBox       = new ToolStripMenuItem("Add Element");

            addBox.Click += new EventHandler(On_Add_Box_Click);
            menuStripBox.Items.Add(addBox);
            elementsNode.ContextMenuStrip = menuStripBox;
            for (int i = 0; i < _linkedModel.Boxes.Count; i++)
            {
                TreeNodeElement boxNode = _linkedModel.Boxes[i].TreeNode;
                elementsNode.Nodes.Add(boxNode);
            }

            ControlTreeNode   texturesNode = new ControlTreeNode("Textures");
            ContextMenuStrip  menuStripTex = new ContextMenuStrip();
            ToolStripMenuItem addTex       = new ToolStripMenuItem("Add Texture");

            addTex.Click += new EventHandler(On_Add_Tex_Click);
            menuStripTex.Items.Add(addTex);
            texturesNode.ContextMenuStrip = menuStripTex;
            for (int i = 0; i < _linkedModel.Textures.Count; i++)
            {
                if (_linkedModel.Textures[i].Name != "MissingT")
                {
                    texturesNode.Nodes.Add(_linkedModel.Textures[i].TreeNode);
                }
            }

            TreeNodeBool ambientNode = new TreeNodeBool("AmbientOcclusion", _linkedModel.AmbientOcclusion);

            ambientNode.ValueChanged += new TreeNodeValueChangedHandler(On_Ambient_Changed);

            elementsNode.Expand();
            texturesNode.Expand();
            Nodes.Add(elementsNode);
            Nodes.Add(texturesNode);
            Nodes.Add(ambientNode);
            Expand();
        }