コード例 #1
0
        /// <summary>
        /// Open a window for selecting scan numbers for display.
        /// </summary>
        /// <param name="scanSelectionViewModel">The view model for the dialog.</param>
        /// <returns>A value indicating whether the user clicked OK on the dialog.</returns>
        public bool OpenScanSelectionWindow(ScanSelectionViewModel scanSelectionViewModel)
        {
            var window = new ScanSelectionWindow {
                DataContext = scanSelectionViewModel
            };

            scanSelectionViewModel.ReadyToClose += (o, e) => window.Close();
            window.ShowDialog();
            return(scanSelectionViewModel.Status);
        }
コード例 #2
0
        /// <summary>
        /// Implementation for the <see cref="OpenScanSelectionCommand" />.
        /// Opens scans selection window to allow users to select scans,
        /// and then updates the plots.
        /// </summary>
        private void OpenScanSelectionImplementation()
        {
            var lcms    = this.FragmentationSequenceViewModel.FragmentationSequence.LcMsRun as LcMsRun;
            var msLevel = this.Spectrum is ProductSpectrum ? 2 : 1;

            if (this.scanSelectionViewModel == null || !this.scanSelectionViewModel.Contains(this.Spectrum.ScanNum))
            {
                var scans   = lcms.GetScanNumbers(msLevel);
                int minScan = 0;
                int maxScan = 0;
                if (this.Spectrum != null)
                {
                    minScan = this.Spectrum.ScanNum;
                    maxScan = this.Spectrum.ScanNum;
                }

                this.scanSelectionViewModel = new ScanSelectionViewModel(this.Spectrum.MsLevel, scans)
                {
                    MinScanNumber = minScan,
                    MaxScanNumber = maxScan,
                    BaseScan      = minScan
                };
            }

            if (this.dialogService.OpenScanSelectionWindow(this.scanSelectionViewModel))
            {
                this.Spectrum = this.scanSelectionViewModel.GetSelectedSpectrum(lcms);
                this.Title    = this.scanSelectionViewModel.ScanNumbers.Count > 1 ?
                                string.Format(
                    "Summed MS{0} Spectra (Scans {1}-{2})",
                    msLevel,
                    this.scanSelectionViewModel.ScanNumbers.Min(),
                    this.scanSelectionViewModel.ScanNumbers.Max()) :
                                string.Format("MS{0} Spectrum (Scan: {1})", msLevel, this.Spectrum.ScanNum);
            }
        }
コード例 #3
0
 public bool OpenScanSelectionWindow(ScanSelectionViewModel scanSelectionViewModel)
 {
     throw new NotImplementedException();
 }