// Rename the section after the text of the tree node has changed. // Cancel if the text is empty. private void TOCTree_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) { if (e.Node.Tag != null && e.Label != null && e.Label.Trim() != "") { mProjectView.RenameSectionNode((SectionNode)e.Node.Tag, e.Label); } else { e.CancelEdit = true; mProjectView.Selection = new NodeSelection((SectionNode)e.Node.Tag, this); } }