public void UpdateValues()
 {
     this.UpdateValue(_linkedBox.Name);
     foreach (ControlTreeNode node in Nodes)
     {
         if (node.Name == "Faces")
         {
             foreach (TreeNodeFace faceNode in node.Nodes)
             {
                 faceNode.UpdateValues();
             }
         }
         if (node.Name == "Shade")
         {
             TreeNodeBool shadeNode = (TreeNodeBool)node;
             shadeNode.UpdateValue(_linkedBox.Shade);
         }
         if (node.Name == "From")
         {
             TreeNodeVector3 fromNode = (TreeNodeVector3)node;
             fromNode.UpdateValue(_linkedBox.From);
         }
         if (node.Name == "To")
         {
             TreeNodeVector3 toNode = (TreeNodeVector3)node;
             toNode.UpdateValue(_linkedBox.To);
         }
         if (node.Name == "Rotation")
         {
             TreeNodeRotation rotNode = (TreeNodeRotation)node;
             rotNode.UpdateValues();
         }
     }
 }
        private void Configurate()
        {
            this.ImageIndex       = 2;
            base.ValueChanged    += new TreeNodeValueChangedHandler(On_Name_Changed);
            base.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);

            ContextMenuStrip  menuStripBox = new ContextMenuStrip();
            ToolStripMenuItem removeBox    = new ToolStripMenuItem("Remove Element");

            removeBox.Click += new EventHandler(On_Remove_Box_Click);
            menuStripBox.Items.Add(removeBox);
            ContextMenuStrip = menuStripBox;

            ControlTreeNode facesNode = new ControlTreeNode("Faces");

            facesNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);
            for (int i = 0; i < _linkedBox.Faces.Count; i++)
            {
                TreeNodeFace faceNode = _linkedBox.Faces[i].TreeNode;
                facesNode.Nodes.Add(faceNode);
            }

            TreeNodeBool shadeNode = new TreeNodeBool("Shade", _linkedBox.Shade);

            shadeNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);
            shadeNode.ValueChanged    += new TreeNodeValueChangedHandler(On_Shade_Changed);

            TreeNodeVector3 fromNode = new TreeNodeVector3("From", _linkedBox.From, -16, 32, 2);

            fromNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);
            fromNode.ValueChanged    += new TreeNodeValueChangedHandler(On_From_Changed);

            TreeNodeVector3 toNode = new TreeNodeVector3("To", _linkedBox.To, -16, 32, 2);

            toNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);
            toNode.ValueChanged    += new TreeNodeValueChangedHandler(On_To_Changed);

            TreeNodeRotation rotNode = _linkedBox.Rotation.TreeNode;

            rotNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);

            Nodes.Add(facesNode);
            Nodes.Add(fromNode);
            Nodes.Add(toNode);
            Nodes.Add(shadeNode);
            Nodes.Add(rotNode);
        }