// ------------------------------------------------------------------- /// <summary> /// Populates this node's children if they have not already been /// created. /// </summary> /// <param name="load"> /// True if this should also cause remote imported groups to be loaded. /// </param> public void PopulateChildren(bool load) { if (this.FirstNode is PlaceholderTreeNode) { this.FirstNode.Remove(); List <ITarget> children = new List <ITarget>(); ComputeImmediateChildren(target, children, load); foreach (ITarget child in children) { TargetTreeNode childNode = new TargetTreeNode(child); this.Nodes.Add(childNode); } } }
// ------------------------------------------------------------------- /// <summary> /// Expands all of the local (non-imported) assignment groups in the /// tree view. Delay-loaded groups are not automatically expanded since /// they potentially require slower network access. /// </summary> /// <param name="parent"> /// The node that should be expanded. /// </param> private void ExpandLocalGroups(TargetTreeNode parent) { if (parent.Target.IsLoaded) { parent.PopulateChildren(false); parent.Expand(); foreach (TreeNode child in parent.Nodes) { TargetTreeNode targetChild = child as TargetTreeNode; if (targetChild != null) { ExpandLocalGroups(targetChild); } } } }
// ------------------------------------------------------------------- /// <summary> /// Called when the form is loaded to initialize various UI components. /// </summary> /// <param name="sender"> /// The form being loaded. /// </param> /// <param name="e"> /// The event arguments describing the event. /// </param> private void SubmitterWizard_Load(object sender, EventArgs e) { // Add submission targets to the tree view. foreach (ITarget target in engine.Root.Children) { TargetTreeNode node = new TargetTreeNode(target); submissionTargetsTree.Nodes.Add(node); ExpandLocalGroups(node); } UpdateSubmittablesField(); UpdateNextEnablement(); }
// ------------------------------------------------------------------- /// <summary> /// Populates this node's children if they have not already been /// created. /// </summary> /// <param name="load"> /// True if this should also cause remote imported groups to be loaded. /// </param> public void PopulateChildren(bool load) { if (this.FirstNode is PlaceholderTreeNode) { this.FirstNode.Remove(); List<ITarget> children = new List<ITarget>(); ComputeImmediateChildren(target, children, load); foreach (ITarget child in children) { TargetTreeNode childNode = new TargetTreeNode(child); this.Nodes.Add(childNode); } } }