コード例 #1
0
        private void browseToResultsFileButton_Click(object sender, EventArgs e)
        {
            MsDataFileUri[] dataSources;
            using (var dlg = new OpenDataSourceDialog(Settings.Default.ChorusAccountList)
            {
                Text = Resources.ImportResultsControl_browseToResultsFileButton_Click_Import_Peptide_Search,
                InitialDirectory = new MsDataFilePath(DocumentDirectory)
            })
            {
                // Use saved source type, if there is one.
                string sourceType = Settings.Default.SrmResultsSourceType;
                if (!string.IsNullOrEmpty(sourceType))
                {
                    dlg.SourceTypeName = sourceType;
                }

                if (dlg.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }

                dataSources = dlg.DataSources;
            }

            if (dataSources == null || dataSources.Length == 0)
            {
                MessageDlg.Show(this, Resources.ImportResultsDlg_GetDataSourcePathsFile_No_results_files_chosen);
                return;
            }

            Array.ForEach(dataSources, d => ImportPeptideSearch.TryMatch(d.ToString(), true));
            UpdateResultsFilesUI();
        }