/// <summary>
        /// Clear all the configurations.
        /// This is done when a new project is selected.
        /// </summary>
        private void ClearConfig()
        {
            _SelectedValidationTestVM = null;

            foreach (var vm in _validationTestVMDict.Values)
            {
                vm.Dispose();
            }

            _validationTestVMDict.Clear();
            this.NotifyOfPropertyChange(() => this.ValidationTestVMList);
        }
        /// <summary>
        /// Remove the display based off the SubsystemDataConfig
        /// given in the event.
        /// </summary>
        /// <param name="closeVmEvent">Contains the SubsystemDataConfig to remove the display.</param>
        public void Handle(CloseVmEvent closeVmEvent)
        {
            // Check if the display exist
            if (_validationTestVMDict.ContainsKey(closeVmEvent.SubsysDataConfig))
            {
                // Dispose the display then remove the display
                _validationTestVMDict[closeVmEvent.SubsysDataConfig].Dispose();
                ValidationTestViewModel vm = null;
                if (_validationTestVMDict.TryRemove(closeVmEvent.SubsysDataConfig, out vm))
                {
                    this.NotifyOfPropertyChange(() => this.ValidationTestVMList);

                    // Select a tab is nothing is selected
                    if (SelectedValidationTestVM == null)
                    {
                        if (ValidationTestVMList.Count > 0)
                        {
                            SelectedValidationTestVM = ValidationTestVMList[0];
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
 public void Setup()
 {
     _viewModel = new ValidationTestViewModel();
 }
Exemplo n.º 4
0
        /// <summary>
        /// Shutdown the view model.
        /// </summary>
        /// <param name="close"></param>
        void IDeactivate.Deactivate(bool close)
        {
            // Shutdown the pulse manager
            PulseManager pm = IoC.Get <PulseManager>();

            if (pm != null)
            {
                pm.Dispose();
            }

            // Shutdown the singleton HomeViewModels
            HomeViewModel homeVM = IoC.Get <HomeViewModel>();

            if (homeVM != null)
            {
                homeVM.Dispose();
            }

            // Shutdown the singleton ViewDataBaseViewModel
            ViewDataBaseViewModel viewDataVM = IoC.Get <ViewDataBaseViewModel>();

            if (viewDataVM != null)
            {
                viewDataVM.Dispose();
            }

            // Shutdown the singleton PlaybackViewModel
            PlaybackViewModel playbackVM = IoC.Get <PlaybackViewModel>();

            if (playbackVM != null)
            {
                playbackVM.Dispose();
            }

            // Shutdown the singleton ValidationTestViewModel
            ValidationTestViewModel vtVM = IoC.Get <ValidationTestViewModel>();

            if (vtVM != null)
            {
                vtVM.Dispose();
            }

            // Shutdown the singleton CompassCalViewModel
            CompassCalViewModel ccVM = IoC.Get <CompassCalViewModel>();

            if (ccVM != null)
            {
                ccVM.Dispose();
            }

            // Shutdown the singleton ViewDataBaseGraphicalViewModel
            ViewDataBaseGraphicalViewModel vdGraph = IoC.Get <ViewDataBaseGraphicalViewModel>();

            if (vdGraph != null)
            {
                vdGraph.Dispose();
            }

            // Shutdown the singleton ViewDataBaseTextViewModel
            ViewDataBaseTextViewModel vdText = IoC.Get <ViewDataBaseTextViewModel>();

            if (vdText != null)
            {
                vdText.Dispose();
            }

            // Shutdown the singleton ScreenDataBaseViewModel
            ScreenDataBaseViewModel sdVM = IoC.Get <ScreenDataBaseViewModel>();

            if (sdVM != null)
            {
                sdVM.Dispose();
            }

            // Shutdown the singleton AveragingBaseViewModel
            AveragingBaseViewModel abVM = IoC.Get <AveragingBaseViewModel>();

            if (abVM != null)
            {
                abVM.Dispose();
            }

            // Shutdown the singleton ValidationTestBaseViewModel
            ValidationTestBaseViewModel vtbVM = IoC.Get <ValidationTestBaseViewModel>();

            if (vtbVM != null)
            {
                vtbVM.Dispose();
            }

            // Shutdown the singleton DownloadDataViewModel
            DownloadDataViewModel ddVM = IoC.Get <DownloadDataViewModel>();

            if (ddVM != null)
            {
                ddVM.Dispose();
            }

            // Shutdown the singleton UpdateFirmwareViewModel
            UpdateFirmwareViewModel ufVM = IoC.Get <UpdateFirmwareViewModel>();

            if (ufVM != null)
            {
                ufVM.Dispose();
            }

            // Shutdown the singleton CompassUtilityViewModel
            CompassUtilityViewModel cuVM = IoC.Get <CompassUtilityViewModel>();

            if (cuVM != null)
            {
                cuVM.Dispose();
            }

            // Shutdown the singleton RtiCompassCalViewModel
            RtiCompassCalViewModel rtiCcVM = IoC.Get <RtiCompassCalViewModel>();

            if (rtiCcVM != null)
            {
                rtiCcVM.Dispose();
            }

            //// Shutdown the singleton TerminalViewModel
            //TerminalViewModel termVM = IoC.Get<TerminalViewModel>();
            //if (termVM != null)
            //{
            //    termVM.Dispose();
            //}

            //// Shutdown the singleton TerminalAdcpViewModel
            //TerminalAdcpViewModel tadcpVM = IoC.Get<TerminalAdcpViewModel>();
            //if (tadcpVM != null)
            //{
            //    tadcpVM.Dispose();
            //}

            //// Shutdown the singleton TerminalNavViewModel
            //TerminalNavViewModel tnavVM = IoC.Get<TerminalNavViewModel>();
            //if (tnavVM != null)
            //{
            //    tnavVM.Dispose();
            //}

            // Shutdown the singleton AboutViewModel
            AboutViewModel aboutVM = IoC.Get <AboutViewModel>();

            if (aboutVM != null)
            {
                aboutVM.Dispose();
            }

            // Shutdown the singleton VesselMountViewModel
            VesselMountViewModel vmVM = IoC.Get <VesselMountViewModel>();

            if (vmVM != null)
            {
                vmVM.Dispose();
            }

            // Shutdown the singleton VesselMountViewModel
            DataOutputViewModel vmDO = IoC.Get <DataOutputViewModel>();

            if (vmDO != null)
            {
                vmDO.Dispose();
            }

            // Shutdown the singleton VesselMountViewModel
            WpMagDirOutputViewModel vmWMD = IoC.Get <WpMagDirOutputViewModel>();

            if (vmWMD != null)
            {
                vmWMD.Dispose();
            }

            // Shutdown the last active item
            DeactivateItem(ActiveItem, true);

            // MAKE THIS THE LAST THING TO SHUTDOWN
            // Shutdown the ADCP connection
            AdcpConnection adcp = IoC.Get <AdcpConnection>();

            if (adcp != null)
            {
                adcp.Dispose();
            }

            // Shutdown the applicaton and all the threads
            Environment.Exit(Environment.ExitCode);
        }