public void editKey(string KeyName = "") { if (KeyName == "") { KeyName = Path.GetFileName(editingNode.Name); } string text = ""; if (File.Exists(editingNode.Name)) { text = File.ReadAllText(editingNode.Name); } FormNewVar nv = new FormNewVar(currengGloablDbPath, KeyName, text); nv.ShowDialog(); if (nv.DialogResult == DialogResult.OK) { File.Delete(editingNode.Name); loadGlobalDb(currengGloablDbPath); } }
private void button3_Click(object sender, EventArgs e) { string name = ""; string originalEditionNode = ""; if (editingNode != null) { originalEditionNode = editingNode.Name; name = Path.GetFileName(editingNode.Name); } FormNewVar nv = new FormNewVar(currengGloablDbPath, name, ""); nv.ShowDialog(); loadGlobalDb(currengGloablDbPath); if (originalEditionNode != "") { TreeNode[] temp = treeView1.Nodes.Find(originalEditionNode, true); if (temp.Length > 0) { temp[0].TreeView.SelectedNode = temp[0]; } } }