Example #1
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 #2
0
 private void Dispose(bool flag)
 {
     if (flag)
     {
         _dicomPrinter        = null;
         _selectPresentations = null;
         _dicomPrinterConfigurationEditorComponent = null;
         if (_dicomPrintSession != null)
         {
             _dicomPrintSession.Dispose();
         }
     }
 }