Exemple #1
0
        public Manager( DockPanel dockPanel )
        {
            this.dockPanel = dockPanel;
            dataSourceMap = new DataSourceMap();

            DockPanel.ActivePaneChanged += new EventHandler( form_GotFocus );

            spectrumProcessingForm = new SpectrumProcessingForm();
            spectrumProcessingForm.ProcessingChanged += new EventHandler( spectrumProcessingForm_ProcessingChanged );
            //spectrumProcessingForm.GlobalProcessingOverrideButton.Click += new EventHandler( processingOverrideButton_Click );
            //spectrumProcessingForm.RunProcessingOverrideButton.Click += new EventHandler( processingOverrideButton_Click );
            spectrumProcessingForm.GotFocus += new EventHandler( form_GotFocus );
            spectrumProcessingForm.HideOnClose = true;

            spectrumAnnotationForm = new SpectrumAnnotationForm();
            spectrumAnnotationForm.AnnotationChanged += new EventHandler( spectrumAnnotationForm_AnnotationChanged );
            spectrumAnnotationForm.GotFocus += new EventHandler( form_GotFocus );
            spectrumAnnotationForm.HideOnClose = true;

            spectrumGlobalDataProcessing = new DataProcessing();

            ShowChromatogramListForNewSources = true;
            ShowSpectrumListForNewSources = true;

            OpenFileUsesCurrentGraphForm = false;
            OpenFileGivesFocus = true;

            LoadDefaultAnnotationSettings();
        }
Exemple #2
0
        public seems(string[] args)
        {
            InitializeComponent();

            seemsRegistryKey = Registry.CurrentUser.OpenSubKey(seemsRegistryLocation);
            if (seemsRegistryKey != null)
            {
                seemsRegistryKey.Close();
            }

            recentFilesMenu = new MruStripMenu(recentFilesFileMenuItem, new MruStripMenu.ClickedHandler(recentFilesFileMenuItem_Click), seemsRegistryLocation + "\\Recent File List", true);

            dataSources = new Map <string, DataSource>();

            setFileControls(true);
            setScanControls(false);

            DummyScanNumberComboBoxHost.Control.Anchor   = System.Windows.Forms.AnchorStyles.Right;
            DummyScanNumberComboBoxHost.Control.AutoSize = false;
            DummyScanNumberComboBoxHost.Control.Enabled  = false;
            DummyScanNumberComboBoxHost.Control.Location = new System.Drawing.Point(0, 0);
            DummyScanNumberComboBoxHost.Control.Name     = "scanNumberComboBox";
            DummyScanNumberComboBoxHost.Control.Size     = new Size(100, 22);
            DummyScanNumberComboBoxHost.Control.TabIndex = 8;
            ToolStrip1.Items.Insert(ToolStrip1.Items.IndexOf(toolStripLabel2), DummyScanNumberComboBoxHost);
            DummyScanNumberComboBoxHost.Enabled      = false;
            DummyScanNumberComboBoxHost.Alignment    = ToolStripItemAlignment.Right;
            DummyScanNumberComboBoxHost.Control.Dock = DockStyle.Fill;
            DummyScanNumberComboBoxHost.AutoSize     = false;

            browseToFileDialog        = new OpenFileDialog();
            browseToFileDialog.Filter =
                "Any spectra format (*.mzData;*.mzXML;*.xml;*.raw;*.wiff;*.mgf;*.dta;fid;*.baf;*.yep)|*.mzData;*.mzXML;*.xml;*.raw;*.wiff;*.mgf;*.dta;fid;*.baf;*.yep|" +
                "mzData (*.mzData;*.xml)|*.mzData;*.xml|" +
                "mzXML (*.mzXML;*.xml)|*.mzXML;*.xml|" +
                "RAW (*.RAW)|*.raw|" +
                "WIFF (*.WIFF)|*.wiff|" +
                "Bruker (fid;*.baf;*.yep)|fid;*.baf;*.yep|" +
                "MGF (*.mgf)|*.mgf|" +
                "DTA (*.dta)|*.dta";
            browseToFileDialog.FilterIndex      = 0;
            browseToFileDialog.InitialDirectory = "C:\\";

            ManagedScan.SpectrumSVGTemplateFilepath = Path.Combine(Application.StartupPath, "SpectrumSVG-template.svg");

            if (args.Length > 0)
            {
                this.BringToFront();
                this.Focus();
                this.Activate();
                this.Show();
                Application.DoEvents();

                try
                {
                    openFile(args[0]);

                    if (args.Length > 1)
                    {
                        try
                        {
                            //browserForm.ScanNumberComboBox.SelectedIndex = Convert.ToInt32( args[1] );
                        } catch
                        {
                        }
                    }
                } catch (Exception ex)
                {
                    string message = ex.Message;
                    if (ex.InnerException != null)
                    {
                        message += "\n\nAdditional information: " + ex.InnerException.Message;
                    }
                    MessageBox.Show(message,
                                    "Error recovering from crash",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                    0, false);
                }
            }
        }