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; }
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; }