Exemplo n.º 1
0
        private void Configurate()
        {
            this.ValueChanged += new TreeNodeValueChangedHandler(On_Name_Changed);

            ContextMenuStrip  menuStripTex = new ContextMenuStrip();
            ToolStripMenuItem removeTex    = new ToolStripMenuItem("Remove Texture");

            removeTex.Click += new EventHandler(On_Remove_Tex_Click);
            menuStripTex.Items.Add(removeTex);
            ContextMenuStrip = menuStripTex;

            if (!_linkedTexture.IsReference)
            {
                TreeNodeString filepathNode = new TreeNodeString("File", _linkedTexture.FilePath);
                filepathNode.ValueChanged += new TreeNodeValueChangedHandler(On_FilePath_Changed);

                TreeNodeString gamePathNode = new TreeNodeString("Game Path", _linkedTexture.GamePath);
                filepathNode.ValueChanged += new TreeNodeValueChangedHandler(On_GamePath_Changed);

                Nodes.Add(filepathNode);
                Nodes.Add(gamePathNode);
            }
            else
            {
                TreeNodeString refNameNode = new TreeNodeString("Reference", _linkedTexture.Reference);
                refNameNode.ValueChanged += new TreeNodeValueChangedHandler(On_Ref_Changed);
                Nodes.Add(refNameNode);
            }
        }
Exemplo n.º 2
0
 public void UpdateValues()
 {
     this.UpdateValue(_linkedTexture.Name);
     foreach (ControlTreeNode node in Nodes)
     {
         if (node.Name == "File")
         {
             TreeNodeString fileNode = (TreeNodeString)node;
             fileNode.UpdateValue(_linkedTexture.FilePath);
         }
         if (node.Name == "Game Path")
         {
             TreeNodeString gameNode = (TreeNodeString)node;
             gameNode.UpdateValue(_linkedTexture.GamePath);
         }
     }
 }