private void files_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) { string pathResult = ""; bool success = false; if (e.Label == null) { return; } if (e.Label == e.Node.Text) { return; } if (e.Label == "") { e.CancelEdit = true; return; } if (e.Node.Nodes.Count > 0) { pathResult = IBMi.RenameDir(e.Node.Tag.ToString(), e.Label); } else { pathResult = IBMi.RenameFile(e.Node.Tag.ToString(), e.Label); } success = (e.Node.Tag.ToString() != pathResult); if (success) { e.Node.Tag = pathResult; } e.CancelEdit = !success; }