/// <summary> /// Constructor. /// </summary> /// <param name="parentHost">The object that hosts the <paramref name="childComponent"/>'s parent component.</param> /// <param name="childComponent">The child application component being hosted.</param> public ChildComponentHost(IApplicationComponentHost parentHost, IApplicationComponent childComponent) : base(childComponent) { Platform.CheckForNullReference(parentHost, "parentHost"); _parentHost = parentHost; }
private void VerificationDicomPrinter() { try { using (VerificationScu scu = new VerificationScu()) { IApplicationComponentHost host1 = base.Host; string str; string offlineAETitle = "MyAETitle"; DicomPrinter item = this._checkableDicomPrinter.Item; string remoteAE = item.AETitle; string remoteHost = item.Host; int remotePort = item.Port; VerificationResult result = scu.Verify(offlineAETitle, remoteAE, remoteHost, remotePort); TimeSpan timeout = TimeSpan.FromSeconds(2.0); scu.Join(timeout); if (result == VerificationResult.Success) { str = "成功!"; host1.ShowMessageBox(str, MessageBoxActions.Ok); } else { str = "失败!"; host1.ShowMessageBox(str, MessageBoxActions.Ok); } } } catch (Exception exception) { DesktopWindow desktopWindow = base.Host.DesktopWindow; ExceptionHandler.Report(exception, desktopWindow); } }
private void Edit() { DicomPrinterEditValidation oih = new DicomPrinterEditValidation { dicomPrinterSummaryComponent = this }; oih.dicomPrinter = this._checkableDicomPrinter.Item; Checkable <DicomPrinter> oldCheckAble = this._checkableDicomPrinter; DicomPrinterEditorComponent component = new DicomPrinterEditorComponent(oih.dicomPrinter); component.Validation.Add(new ValidationRule("Name", new ValidationRule.ValidationDelegate(oih.Validation))); IApplicationComponentHost host = base.Host; DesktopWindow desktopWindow = host.DesktopWindow; if (ApplicationComponentExitCode.Accepted == ApplicationComponent.LaunchAsDialog(desktopWindow, component, "Edit DICOM Printer")) { int num = this._dicomPrinterTable.Items.IndexOf(oldCheckAble); this._dicomPrinterTable.Items.Remove(oldCheckAble); bool isChecked = oldCheckAble.IsChecked; Checkable <DicomPrinter> checkable = new Checkable <DicomPrinter>(oih.dicomPrinter, isChecked); this._dicomPrinterTable.Items.Insert(num, checkable); this.Modified = true; } }
public void Accept() { if (this._dicomPrinter == null) { base.Host.DesktopWindow.ShowMessageBox("请选择打印机", MessageBoxActions.Ok); } else { if (this.HasValidationErrors || this._dicomPrinterConfigurationEditorComponent.HasValidationErrors) { this.ShowValidation(true); this._dicomPrinterConfigurationEditorComponent.ShowValidation(true); } else { IApplicationComponentHost host = base.Host; DesktopWindow desktopWindow = host.DesktopWindow; _dicomPrintSession = new DicomPrintSession(_dicomPrinter.Item, _selectPresentations); // Platform.Log(LogLevel.Info, _dicomPrinter.Item.Config.ToString()); base.Exit(ApplicationComponentExitCode.Accepted); } } }
/// <summary> /// Called by the framework to set the host. /// </summary> /// <remarks> /// For internal framework use only. /// </remarks> public void SetHost(IApplicationComponentHost host) { Platform.CheckForNullReference(host, "host"); _host = host; }