Esempio n. 1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var _patientId = String.Empty;
            var _courseId  = string.Empty;
            var _planId    = String.Empty;

            if (e.Args.Count() > 0)
            {
                _patientId = e.Args.ElementAt(0).Split(';').First();
                if (e.Args.Count() > 1)
                {
                    _courseId = e.Args.ElementAt(0).Split(';').ElementAt(1);
                }
                if (e.Args.Count() > 2)
                {
                    _planId = e.Args.ElementAt(0).Split(';').ElementAt(2);
                }
            }
            try
            {
                app = VMS.TPS.Common.Model.API.Application.CreateApplication();
                IEventAggregator eventAggregator = new EventAggregator();
                var mv = new MainView
                {
                    DataContext = new MainViewModel(
                        new PatientNavigationViewModel(app, _patientId, _courseId, _planId, eventAggregator),
                        new ScanPlotViewModel(eventAggregator))
                };
                mv.ShowDialog();
                app.Dispose();
            }
            catch (ApplicationException ex)
            {
                app.Dispose();
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 2
0
 private void MainWindow_OnClosing(object sender, CancelEventArgs e)
 {
     // Always dispose of the ESAPI Application object before exiting the program
     _app.Dispose();
 }
Esempio n. 3
0
 void OnMainWindowClose(object sender, EventArgs e)
 {
     _vapp.Dispose();
 }