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); } }
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); } } }
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(); } }