Exemplo n.º 1
0
        public DicomServerEditComponent(ServerTree dicomServerTree)
        {
            _serverTree = dicomServerTree;
            if (_serverTree.CurrentNode.IsServer)
            {
                _serverNameReadOnly = true;
                var server = (IServerTreeDicomServer)_serverTree.CurrentNode;
                _serverName        = server.Name;
                _serverLocation    = server.Location;
                _serverAE          = server.AETitle;
                _serverHost        = server.HostName;
                _serverPort        = server.Port;
                _isStreaming       = server.IsStreaming;
                _headerServicePort = server.HeaderServicePort;
                _wadoServicePort   = server.WadoServicePort;

                GetServerNodeMetaProperties(_serverName, out _isPriorsServer);
            }
            else
            {
                _serverNameReadOnly = false;
                _serverName         = String.Empty;
                _serverLocation     = String.Empty;
                _serverAE           = String.Empty;
                _serverHost         = String.Empty;
                _serverPort         = ServerTreeDicomServer.DefaultPort;
                _isStreaming        = false;
                _headerServicePort  = ServerTreeDicomServer.DefaultHeaderServicePort;
                _wadoServicePort    = ServerTreeDicomServer.DefaultWadoServicePort;
            }
        }
Exemplo n.º 2
0
            public ValidationResult GetResult(IApplicationComponent component)
            {
                DicomServerEditComponent serverComponent = (DicomServerEditComponent)component;

                ServerTree serverTree = serverComponent._serverTree;

                bool   isConflicted;
                string conflictingServerPath;

                if (serverTree.CurrentNode.IsServer)
                {
                    isConflicted = !serverTree.CanEditCurrentServer(serverComponent.ServerName,
                                                                    serverComponent.ServerAE,
                                                                    serverComponent.ServerHost,
                                                                    serverComponent.ServerPort, out conflictingServerPath);
                }
                else
                {
                    isConflicted = !serverTree.CanAddServerToCurrentGroup(serverComponent.ServerName,
                                                                          serverComponent.ServerAE,
                                                                          serverComponent.ServerHost,
                                                                          serverComponent.ServerPort, out conflictingServerPath);
                }

                if (isConflicted)
                {
                    return(new ValidationResult(false, String.Format(SR.FormatServerConflict, conflictingServerPath)));
                }

                return(new ValidationResult(true, ""));
            }
Exemplo n.º 3
0
            public ValidationResult GetResult(IApplicationComponent component)
            {
                DicomServerGroupEditComponent groupComponent = (DicomServerGroupEditComponent)component;

                ServerTree serverTree = groupComponent._serverTree;

                bool   valid           = true;
                string conflictingPath = "";

                if (groupComponent._isNewServerGroup && !serverTree.CanAddGroupToCurrentGroup(groupComponent._serverGroupName, out conflictingPath))
                {
                    valid = false;
                }
                else if (!groupComponent._isNewServerGroup && !serverTree.CanEditCurrentGroup(groupComponent._serverGroupName, out conflictingPath))
                {
                    valid = false;
                }

                if (!valid)
                {
                    return(new ValidationResult(false, String.Format(SR.FormatServerGroupConflict, groupComponent._serverGroupName, conflictingPath)));
                }

                return(new ValidationResult(true, ""));
            }
        private void AddNewServerGroup()
        {
            ServerTree _serverTree = this.Context.ServerTree;

            this.Context.UpdateType = (int)ServerUpdateType.Add;
            DicomServerGroupEditComponent editor   = new DicomServerGroupEditComponent(_serverTree, ServerUpdateType.Add);
            ApplicationComponentExitCode  exitCode = ApplicationComponent.LaunchAsDialog(this.Context.DesktopWindow, editor, SR.TitleAddServerGroup);

            this.Context.UpdateType = (int)ServerUpdateType.None;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Constructor
 /// </summary>
 public DicomServerGroupEditComponent(ServerTree dicomServerTree, ServerUpdateType updatedType)
 {
     _isNewServerGroup = updatedType.Equals(ServerUpdateType.Add)? true : false;
     _serverTree       = dicomServerTree;
     if (!_isNewServerGroup)
     {
         _serverGroupName = _serverTree.CurrentNode.Name;
     }
     else
     {
         _serverGroupName = "";
     }
 }
        public ServerTreeComponent()
        {
            _serverTree = new ServerTree();

            if (_serverTree.CurrentNode != null)
            {
                _selectedServers = new DicomServiceNodeList(_serverTree.CurrentNode.ToDicomServiceNodes())
                {
                    Name = _serverTree.CurrentNode.DisplayName, Id = _serverTree.CurrentNode.Path
                };
            }
            else
            {
                _selectedServers = new DicomServiceNodeList();
            }
        }
Exemplo n.º 7
0
        private void EditServer()
        {
            ServerTree serverTree = this.Context.ServerTree;

            this.Context.UpdateType = (int)ServerUpdateType.Edit;

            if (serverTree.CurrentNode.IsServer)
            {
                DicomServerEditComponent     editor   = new DicomServerEditComponent(serverTree);
                ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(this.Context.DesktopWindow, editor, SR.TitleEditServer);
            }
            else
            {
                DicomServerGroupEditComponent editor   = new DicomServerGroupEditComponent(serverTree, ServerUpdateType.Edit);
                ApplicationComponentExitCode  exitCode = ApplicationComponent.LaunchAsDialog(this.Context.DesktopWindow, editor, SR.TitleEditServerGroup);
            }

            this.Context.UpdateType = (int)ServerUpdateType.None;
        }
        private void DeleteServerServerGroup()
        {
            ServerTree serverTree = this.Context.ServerTree;

            if (serverTree.CurrentNode.IsServer)
            {
                if (this.Context.DesktopWindow.ShowMessageBox(SR.MessageConfirmDeleteServer, MessageBoxActions.YesNo) != DialogBoxAction.Yes)
                {
                    return;
                }

                this.Context.UpdateType = (int)ServerUpdateType.Delete;
                serverTree.DeleteCurrentNode();
                serverTree.Save();
                this.Context.UpdateType = (int)ServerUpdateType.None;
            }
            else if (serverTree.CurrentNode.IsServerGroup)
            {
                if (this.Context.DesktopWindow.ShowMessageBox(SR.MessageConfirmDeleteServerGroup, MessageBoxActions.YesNo) != DialogBoxAction.Yes)
                {
                    return;
                }

                this.Context.UpdateType = (int)ServerUpdateType.Delete;
                try
                {
                    serverTree.DeleteCurrentNode();
                    serverTree.Save();
                }
                catch (Exception e)
                {
                    ExceptionHandler.Report(e, Context.DesktopWindow);
                }

                this.Context.UpdateType = (int)ServerUpdateType.None;
            }
        }