コード例 #1
0
        private void SaveEFilm(ICommunicationProxy proxy = null, bool ifSaveEFilm = false)
        {
            try
            {
                Logger.LogFuncUp();

                if (_viewerWindow == null)
                {
                    _viewerWindow = new MedViewerWindow(proxy);
                    //MedViewerWindow.ImageBurntEvent += MedViewerWindowOnImageBurntEvent;
                }

                while (true)
                {
                    try
                    {
                        //window.Hide();
                        //Console.WriteLine("Thread: wait a job");
                        windowLockEvent.WaitOne();
                        var electronicFilmInfo = new ElectronicFilmInfo((int)_row, (int)_column, filmImageList);
                        _viewerWindow.FilmInfo = electronicFilmInfo;
                        _viewerWindow.SetRenderSize(_size);
                        _viewerWindow.ShowAllImages();
                        _viewerWindow.Show();
                        _viewerWindow.SaveEfilm(_efilmFullPath, ref _efilmOriginalSopInstanceUID, ref _efilmOriginalStudyInstanceUid, ifSaveEFilm);
                        _viewerWindow.Hide();
                        MedViewerWindowOnImageBurntEvent(); //MedViewerWindow.RaiseImageBurntEvent();
                        windowLockEvent.Reset();
                        //Console.WriteLine("Thread: window lock reset");
                    }
                    catch (Exception ex)
                    {
                        Logger.LogFuncException(ex.Message + ex.StackTrace);
                        _efilmOriginalSopInstanceUID = string.Empty;
                        MedViewerWindowOnImageBurntEvent(); //MedViewerWindow.RaiseImageBurntEvent();
                        windowLockEvent.Reset();
                        //Console.WriteLine("Thread: Exception & window lock reset");
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.LogFuncException(ex.Message + ex.StackTrace);
            }
        }
コード例 #2
0
        private void SaveEFilm(Size renderSize, double dpi)
        {
            try
            {
                Logger.LogFuncUp();

                ElectronicFilmInfo electronicFilmInfo = new ElectronicFilmInfo((int)_row, (int)_column, filmImageList);

                MedViewerWindow viewerWindow = new MedViewerWindow(_proxy);
                viewerWindow.SetRenderSize(renderSize);

                viewerWindow.FilmInfo         = electronicFilmInfo;
                viewerWindow.ContentRendered += new EventHandler(viewerWindow_ContentRendered);
                //viewerWindow.ImageLoadedInViewerControl += viewerWindow_ImageLoaded;

                //Console.WriteLine("show image----begin");
                viewerWindow.ShowAllImages();

                viewerWindow.ShowDialog();
                //Console.WriteLine("show image----end");

                Logger.LogFuncDown();
            }
            catch (Exception ex)
            {
                Logger.LogFuncException(ex.Message + ex.StackTrace);
            }

            ////for test
            //Logger.LogFuncUp();

            //var window = new Window();
            ////window.ContentRendered += new EventHandler(viewerWindow_ContentRendered);
            //window.ShowDialog();

            //Logger.LogFuncDown();
        }