Beispiel #1
0
        public void Accept()
        {
            ServerAE       = ServerAE.Trim();
            ServerName     = ServerName.Trim();
            ServerLocation = ServerLocation.Trim();
            ServerHost     = ServerHost.Trim();

            if (base.HasValidationErrors)
            {
                this.ShowValidation(true);
            }
            else
            {
                var current          = _serverTree.CurrentNode;
                var allButCurrent    = _serverTree.RootServerGroup.GetAllServers().Where(s => s != current).Cast <IServerTreeDicomServer>();
                var sameAETitleCount = allButCurrent.Count(s => s.AETitle == _serverAE);
                if (sameAETitleCount > 0)
                {
                    var message = sameAETitleCount == 1
                                      ? SR.ConfirmAETitleConflict_OneServer
                                      : String.Format(SR.ConfirmAETitleConflict_MultipleServers, sameAETitleCount);

                    if (DialogBoxAction.No == Host.DesktopWindow.ShowMessageBox(message, MessageBoxActions.YesNo))
                    {
                        return;
                    }
                }

                var newServer = new ServerTreeDicomServer(
                    _serverName,
                    _serverLocation,
                    _serverHost,
                    _serverAE,
                    _serverPort,
                    _isStreaming,
                    _headerServicePort,
                    _wadoServicePort);

                // edit current server
                if (_serverTree.CurrentNode.IsServer)
                {
                    _serverTree.ReplaceDicomServerInCurrentGroup(newServer);
                }
                // add new server
                else if (_serverTree.CurrentNode.IsServerGroup)
                {
                    ((IServerTreeGroup)_serverTree.CurrentNode).AddChild(newServer);
                    _serverTree.CurrentNode = newServer;
                }

                _serverTree.Save();

                SetServerNodeMetaProperties(_serverName, _isPriorsServer);

                _serverTree.FireServerTreeUpdatedEvent();

                this.ExitCode = ApplicationComponentExitCode.Accepted;
                Host.Exit();
            }
        }
Beispiel #2
0
        public void Accept()
        {
            ServerGroupName = ServerGroupName.Trim();

            if (base.HasValidationErrors)
            {
                base.ShowValidation(true);
            }
            else
            {
                if (!_isNewServerGroup)
                {
                    var serverGroup = (IServerTreeGroup)_serverTree.CurrentNode;
                    serverGroup.Name = _serverGroupName;
                }
                else
                {
                    var serverGroup = new ServerTreeGroup(_serverGroupName);
                    ((ServerTreeGroup)_serverTree.CurrentNode).AddChild(serverGroup);
                    _serverTree.CurrentNode = serverGroup;
                }

                _serverTree.Save();
                _serverTree.FireServerTreeUpdatedEvent();

                this.ExitCode = ApplicationComponentExitCode.Accepted;
                Host.Exit();
            }
        }