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, ""));
            }
Example #2
0
        private void AddNewServer()
        {
            ServerTree serverTree = this.Context.ServerTree;

            this.Context.UpdateType = (int)ServerUpdateType.Add;
            DicomServerEditComponent     editor   = new DicomServerEditComponent(serverTree);
            ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(this.Context.DesktopWindow, editor, SR.TitleAddNewServer);

            this.Context.UpdateType = (int)ServerUpdateType.None;
        }
Example #3
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;
        }