Пример #1
0
        static void Main(string[] args)
        {
            if (!Support.SetLicense())
            {
                return;
            }

            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                Leadtools.Dicom.DicomEngine.Startup( );
                Leadtools.Dicom.DicomNet.Startup( );

                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

                new WorkstationShellController( ).Run( );
            }
            catch (Exception exception)
            {
                ViewErrorDetailsDialog detailedError;


                detailedError = new ViewErrorDetailsDialog(exception);

                detailedError.ShowDialog( );
            }
            finally
            {
                Leadtools.Dicom.DicomEngine.Shutdown( );
                Leadtools.Dicom.DicomNet.Shutdown( );
            }
        }
Пример #2
0
        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            ViewErrorDetailsDialog detailedError;


            detailedError = new ViewErrorDetailsDialog(e.Exception);

            detailedError.ShowDialog( );
        }
Пример #3
0
        public void Run( )
        {
            MainForm          mainForm;
            WorkstationViewer viewer;
            ExamplesMenuStrip examplesMenu;
            TextBox           examplesDescription;



            Messager.Caption            = "Workstation Customization Demo";
            WorkstationMessager.Caption = "Workstation Customization Demo";

            WorkstationUISettings.Instance.Controls.Add(new NameTypeConfigurationElement(UIElementKeys.WorkstastionControl,
                                                                                         typeof(WorkstationViewer)));

            WorkstationUISettings.Instance.Controls.Add(new NameTypeConfigurationElement(UIElementKeys.ExamplesMenuStrip,
                                                                                         typeof(ExamplesMenuStrip)));

            WorkstationUISettings.Instance.Controls.Add(new NameTypeConfigurationElement(UIElementKeys.ExamplesDescription,
                                                                                         typeof(TextBox)));

            viewer = WorkstationUIFactory.Instance.GetWorkstsationControl <WorkstationViewer> (UIElementKeys.WorkstastionControl);
            viewer.Options3D.SupportPanoramic = true;
            examplesMenu        = WorkstationUIFactory.Instance.GetWorkstsationControl <ExamplesMenuStrip> (UIElementKeys.ExamplesMenuStrip);
            examplesDescription = WorkstationUIFactory.Instance.GetWorkstsationControl <TextBox> (UIElementKeys.ExamplesDescription);

            try
            {
                mainForm = new MainForm( );

                viewer.Dock = DockStyle.Fill;

                mainForm.MainMenuStrip = examplesMenu;

                mainForm.Controls.Add(viewer);
                mainForm.Controls.Add(examplesMenu);

                viewer.BringToFront( );

                examplesDescription.Dock      = DockStyle.Fill;
                examplesDescription.Multiline = true;
                examplesDescription.ReadOnly  = true;
                examplesDescription.BackColor = Color.Black;
                examplesDescription.ForeColor = Color.White;

                mainForm.DescriptionPanel.Controls.Add(examplesDescription);

                examplesDescription.BringToFront( );

                __ViewerContainer = viewer.ViewerContainer;

                __ViewerContainer.State.ModalityManager.FillDefaultOptions( );

                viewer.SeriesDropLoaderRequested += new EventHandler <SeriesDropLoaderRequestedEventArgs> (viewer_SeriesDropLoaderRequested);

                viewer.SeriesLoadingCompleted += new EventHandler <LoadSeriesEventArgs>(viewer_SeriesLoadingCompleted);

                new WorkstationCustomizationController( );

                Application.Run(mainForm);
            }
            catch (Exception ex)
            {
                ViewErrorDetailsDialog detailedError;


                detailedError = new ViewErrorDetailsDialog(ex);

                detailedError.ShowDialog( );
            }
            finally
            {
                if (null != viewer &&
                    !viewer.IsDisposed)
                {
                    viewer.Dispose( );
                }
            }
        }
Пример #4
0
        static void Main(string[] args)
        {
#pragma warning disable 436

#if LEADTOOLS_V19_OR_LATER
            if (!Support.SetLicense())
            {
                return;
            }
#else
            Support.SetLicense();
            if (RasterSupport.KernelExpired)
            {
                return;
            }
#endif

#pragma warning restore 436

            if (Elevation.Restart())
            {
                DemosGlobal.TryRestartElevated(args);
                return;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

#if (LEADTOOLS_V20_OR_LATER)
            if (DemosGlobal.IsDotNet45OrLaterInstalled() == false)
            {
                MessageBox.Show("To run this application, you must first install Microsoft .NET Framework 4.5 or later.",
                                "Microsoft .NET Framework 4.5 or later Required",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
                return;
            }
#endif

            try
            {
                Leadtools.Dicom.DicomEngine.Startup( );
                Leadtools.Dicom.DicomNet.Startup( );

                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

                WorkstationShellController.Instance.Run( );
            }
            catch (Exception exception)
            {
                ViewErrorDetailsDialog detailedError;


                detailedError = new ViewErrorDetailsDialog(exception);

                detailedError.ShowDialog( );
            }
            finally
            {
                Leadtools.Dicom.DicomEngine.Shutdown( );
                Leadtools.Dicom.DicomNet.Shutdown( );
            }
        }
Пример #5
0
        static void Main(string[] args)
        {
#pragma warning disable 436

            if (!Support.SetLicense())
            {
                return;
            }

#pragma warning restore 436

            if (DemosGlobal.MustRestartElevated())
            {
                DemosGlobal.TryRestartElevated(args);
                return;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


            try
            {
                string dicomDirFile;

                Leadtools.Dicom.DicomEngine.Startup( );
                Leadtools.Dicom.DicomNet.Startup( );

                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

                dicomDirFile = GetDicomDir( );

                if (!string.IsNullOrEmpty(dicomDirFile))
                {
                    ConfigurationData.CurrentDicomDir           = dicomDirFile;
                    ConfigurationData.SupportDicomCommunication = false;
                    ConfigurationData.SupportLocalQueriesStore  = false;
                    ConfigurationData.SaveSessionBehavior       = SaveOptions.NeverSave;
                    ConfigurationData.ClientBrowsingMode        = DicomClientMode.DicomDir;
                    ConfigurationData.RunPacsConfig             = false;
                    ConfigurationData.CheckDataAccessServices   = false;
                    ConfigurationData.ShowSplashScreen          = false;
                    ConfigurationData.AutoQuery = true;

                    UserAccessManager.SetAuthenticatedUser(new User("guest", false));

                    if (ConfigurationData.ApplicationName == "Medical Workstation Viewer Main Demo")
                    {
                        ConfigurationData.ApplicationName = "Medical Workstation Viewer DICOM DIR Demo";
                    }

                    WorkstationShellController.Instance.Run( );
                }
            }
            catch (Exception exception)
            {
                ViewErrorDetailsDialog detailedError;


                detailedError = new ViewErrorDetailsDialog(exception);

                detailedError.ShowDialog( );
            }
            finally
            {
                Leadtools.Dicom.DicomEngine.Shutdown( );
                Leadtools.Dicom.DicomNet.Shutdown( );
            }
        }