private static void SelectPriorsServers(ServerTreeComponent serverTreeComponent)
        {
            ServerTree serverTree = serverTreeComponent.ServerTree;

            var priorsServers = ServerDirectory.GetPriorsServers(false);

            CheckPriorsServers(serverTree, priorsServers);
            IServerTreeNode initialSelection = GetFirstPriorsServerOrGroup(serverTree.RootServerGroup);

            UncheckAllServers(serverTree);

            if (initialSelection == null)
            {
                if (serverTreeComponent.ShowLocalServerNode)
                {
                    initialSelection = serverTreeComponent.ServerTree.LocalServer;
                }
                else
                {
                    initialSelection = serverTreeComponent.ServerTree.RootServerGroup;
                }
            }

            serverTreeComponent.SetSelection(initialSelection);
        }
 private static void SelectPriorsServerNode(ServerTreeComponent serverTreeComponent)
 {
     if (serverTreeComponent.ShowLocalServerNode && !DicomExplorerConfigurationSettings.Default.SelectDefaultServerOnStartup)
     {
         serverTreeComponent.SetSelection(serverTreeComponent.ServerTree.LocalServer);
     }
     else
     {
         SelectPriorsServers(serverTreeComponent);
     }
 }
Exemplo n.º 3
0
        private void SetInitialSelection()
        {
            SelectCurrentServerTreeNode();

            if (this._aeTreeView.SelectedNode == null)
            {
                if (_component.ShowLocalServerNode)
                {
                    SelectLocalServerNode();
                }
                else
                {
                    SelectRootServerGroupNode();
                }
            }
            else if (_component.ServerTree.CurrentNode is IServerTreeGroup)
            {
                //expand if it's a group
                this._aeTreeView.SelectedNode.Expand();
            }

            _lastClickedNode = _aeTreeView.SelectedNode;
            if (_lastClickedNode != null)
            {
                _component.SetSelection(_lastClickedNode.Tag as IServerTreeNode);
            }
        }