예제 #1
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, ""));
            }