Ejemplo n.º 1
0
 private void changeKeyToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Enter_text et = new Enter_text("Change key", pathName(treeView1.SelectedNode.Tag.ToString()));
     if(et.ShowDialog() == DialogResult.OK)
     {
         EGE.Tools.NodeCollection collection = (EGE.Tools.NodeCollection)getValue(pathUp(treeView1.SelectedNode.Tag.ToString()));
         collection.Add(et.NewValue, collection.Get(et.OldValue));
         collection.Remove(et.OldValue);
         UpdateArray(pathUp(treeView1.SelectedNode.Tag.ToString()));
         UpdateWorld.Invoke(this, null);
     }
 }
Ejemplo n.º 2
0
 private void insertToolStripMenuItem_Click(object sender, EventArgs e)
 {
     EGE.Tools.NodeCollection collection = (EGE.Tools.NodeCollection)getValue(treeView1.SelectedNode.Tag.ToString());
     if (collection.AutoIncrement)
     {
         collection.Add(Activator.CreateInstance(collection.contentType));
         UpdateArray(pathUp(treeView1.SelectedNode.Tag.ToString()));
         UpdateWorld.Invoke(this, null);
     }
     else
     {
         Enter_text et = new Enter_text("Enter key", "", collection.AvaliableTypes.Select(t => t.ToString()).ToArray());
         if (et.ShowDialog() == DialogResult.OK)
         {
             collection.Add(et.NewValue, Activator.CreateInstance(collection.AvaliableTypes[et.selectedOption]));
             UpdateArray(pathUp(treeView1.SelectedNode.Tag.ToString()));
             UpdateWorld.Invoke(this, null);
         }
     }
 }
Ejemplo n.º 3
0
 private void newFolderToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Enter_text dialog = new Enter_text();
     if(dialog.ShowDialog() == DialogResult.OK)
     {
         treeView1.SelectedNode.Nodes.Add(dialog.Text);
         treeView1.SelectedNode.Expand();
     }
 }