public SectionTreeNode GetChildNode(SectionSettings parentSection, SectionSettings section) { SectionTreeNode treeNode = new SectionTreeNode(section); SectionTreeNode parentTreeNode = (SectionTreeNode)settingSections[parentSection.Text]; for (int i = 0; i < parentTreeNode.GetNodeCount(true); i++) { if (parentTreeNode.Nodes[i].Name == section.Text) { return(treeNode); } } return(null); }
public void RemoveChildSection(SectionSettings parentSection, SectionSettings section) { // Remove section from tree if (parentSection != null) { SectionTreeNode parentTreeNode = (SectionTreeNode)settingSections[parentSection.Text]; for (int i = 0; i < parentTreeNode.GetNodeCount(true); i++) { if (parentTreeNode.Nodes[i].Name == section.Text) { //Remove the section from the hashtable in case we add it again settingSections.Remove(section.Text); parentTreeNode.Nodes.Remove(parentTreeNode.Nodes[i]); } } } }