public override FaxHierarchyTreeNode InvokeAdd() { AreaTreeNode areaNode = new AreaTreeNode(); this.Nodes.Add(areaNode); this.ExpandAll(); // Add to section if (Definition != null) { Definition.Areas.Add(areaNode.Definition); } return(areaNode); }
/// <summary> /// Updates the form by reading the current control information. /// </summary> private void UpdateFromControlInformation() { this.trvHierarchy.Nodes.Clear(); // Create root node RootTreeNode root = new RootTreeNode(); root.ControlInformation = _controlInformation; root.Tag = _controlInformation; root.Text = _controlInformation.FaxName; // Create sections foreach (SectionDefinition sd in _controlInformation.Sections) { SectionTreeNode section = new SectionTreeNode(); section.Tag = sd; section.Definition = sd; foreach (AreaDefinition ad in sd.Areas) { AreaTreeNode area = new AreaTreeNode(); area.Tag = ad; area.Definition = ad; section.Nodes.Add(area); } root.Nodes.Add(section); } this.trvHierarchy.Nodes.Add(root); this.trvHierarchy.SelectedNode = root; this.trvHierarchy.ExpandAll(); }
public override FaxHierarchyTreeNode InvokeAdd() { AreaTreeNode areaNode = new AreaTreeNode(); this.Nodes.Add(areaNode); this.ExpandAll(); // Add to section if (Definition != null) { Definition.Areas.Add(areaNode.Definition); } return areaNode; }