public VirtualTreeNode CreateNewRootNode(Search search, TreeSearchBox.Mode mode) { VirtualTreeNode newRootNode; MainWindowTreeNodeGroupAcceptor groupAcceptor; switch (mode) { case TreeSearchBox.Mode.Objects: newRootNode = new VirtualTreeNode(Messages.VIEW_OBJECTS); groupAcceptor = CreateGroupAcceptor(_highlightedDragTarget, newRootNode); OrganizationalView.PopulateObjectView(groupAcceptor, search); break; case TreeSearchBox.Mode.Organization: newRootNode = new VirtualTreeNode(Messages.VIEW_ORGANIZATION); groupAcceptor = CreateGroupAcceptor(_highlightedDragTarget, newRootNode); OrganizationalView.PopulateOrganizationView(groupAcceptor, search); break; default: Util.ThrowIfParameterNull(search, "search"); newRootNode = new VirtualTreeNode("XenCenter"); groupAcceptor = CreateGroupAcceptor(_highlightedDragTarget, newRootNode); search.PopulateAdapters(groupAcceptor); break; } return(newRootNode); }
private void SetDefaultObjectViewExpandedNodes() { VirtualTreeNode dummyRootNode = new VirtualTreeNode(Messages.VIEW_OBJECTS); OrganizationalView.PopulateObjectView(CreateGroupAcceptor(dummyRootNode), TreeSearch.DefaultTreeSearch); foreach (VirtualTreeNode n in dummyRootNode.Nodes) { _objectViewExpandedTags.Add(n.GetPersistenceInfo()); } }