Example #1
0
 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);
     }
 }
Example #2
0
            public bool Equals(Checkable <DicomPrinter> dicomPrinter)
            {
                DicomPrinter item  = dicomPrinter.Item;
                string       text1 = item.Name;

                return(text1 == this.DicomPrinterName);
            }
Example #3
0
        private void TaskTerminated(object sender, BackgroundTaskTerminatedEventArgs args)
        {
            if (_dicomPrintSession != null)
            {
                _dicomPrintSession.Dispose();
                _dicomPrintSession = null;
            }

            if (_selectPresentationsInformations != null)
            {
                foreach (var item in _selectPresentationsInformations)
                {
                    IImageSopProvider   imageSopProvider = item.Image as IImageSopProvider;
                    ILocalSopDataSource localSource      = null;
                    if (imageSopProvider != null)
                    {
                        localSource = imageSopProvider.ImageSop.DataSource as ILocalSopDataSource;
                    }

                    item.Dispose();
                    if (localSource != null)
                    {
                        localSource.Dispose();
                    }
                }

                _dicomPrinter = null;
            }
        }
Example #4
0
            public ValidationResult Validation(IApplicationComponent component)
            {
                DicomPrinter item    = dicomPrinterSummaryComponent._checkableDicomPrinter.Item;
                bool         success = this.dicomPrinterSummaryComponent.Equals(item, this.dicomPrinter);
                string       format  = "DicomPrinterName{0}";

                return(new ValidationResult(success, string.Format(format, dicomPrinter.Name)));
            }
Example #5
0
        private bool Equals(DicomPrinter dicomPrinter1, DicomPrinter dicomPrinter2)
        {
            JudgeDicomPrinter pih = new JudgeDicomPrinter
            {
                dicomPrinter1 = dicomPrinter1,
                dicomPrinter2 = dicomPrinter2,
                dicomPrinterSummaryComponent = this
            };
            ItemCollection <Checkable <DicomPrinter> > items = this._dicomPrinterTable.Items;
            bool flag = CollectionUtils.Contains <Checkable <DicomPrinter> >((IEnumerable <Checkable <DicomPrinter> >)items, new Predicate <Checkable <DicomPrinter> >(pih.Equals));

            return(!flag);
        }
Example #6
0
            public bool Equals(Checkable <DicomPrinter> checkableDicomPrinter)
            {
                if (this.dicomPrinter1 != null)
                {
                    DicomPrinter local1 = checkableDicomPrinter.Item;
                    if (object.ReferenceEquals(local1, this.dicomPrinter1))
                    {
                        return(false);
                    }
                }
                DicomPrinter item = checkableDicomPrinter.Item;

                return(object.Equals(item.Name, dicomPrinter2.Name));
            }
Example #7
0
        public void Print(
            List <ISelectPresentationsInformation> selectPresentationsInformations,
            DicomPrinter dicomPrinter,
            int tileCount,
            bool isAllPages,
            bool isDelete)
        {
            if (_task.IsRunning)
            {
                _desktopWindow.ShowMessageBox("请稍等正在打印中...", MessageBoxActions.Ok);
                return;
            }

            _selectPresentationsInformations = selectPresentationsInformations;
            _dicomPrinter    = dicomPrinter;
            _tileCount       = tileCount;
            _isAllPages      = isAllPages;
            _isPrintedDelete = isDelete;
            _task.Run();
        }
Example #8
0
 private static Checkable <DicomPrinter> WrapperDicomPrinterToCheckable(DicomPrinter dicomPrinter)
 {
     return(new Checkable <DicomPrinter>(dicomPrinter));
 }
 public DicomPrintSession(DicomPrinter dicomPrinter, SelectPresentationsInformationsCollection selectPresentationsCollection)
 {
     this._dicomPrinter = dicomPrinter;
     this._selectPresentationsCollection = selectPresentationsCollection;
 }
Example #10
0
        public object Clone()
        {
            DicomPrinter printer = new DicomPrinter(this.Name, this.AETitle, this.Host, this.Port, this.Config);

            return(printer);
        }
Example #11
0
 public DicomPrinterEditorComponent(DicomPrinter dicomPrinter)
 {
     this._dicomPrinter = dicomPrinter;
 }