Exemplo n.º 1
0
        /// <summary>
        /// At this point a failure in this function probably means the optimization database was used
        /// </summary>
        private bool ValidateOptimizationList(IEnumerable <DbOptimization> optimizationList, string tableName)
        {
            var keySet = new HashSet <OptimizationKey>();

            foreach (DbOptimization optimization in optimizationList)
            {
                string seqModified = optimization.Target.Sequence;
                if (LibraryGridViewDriver.ValidateSequence(seqModified) != null)
                {
                    MessageDlg.Show(this, string.Format(Resources.EditOptimizationLibraryDlg_ValidateOptimizationList_The_value__0__is_not_a_valid_modified_peptide_sequence_,
                                                        seqModified));
                    return(false);
                }

                if (keySet.Contains(optimization.Key))
                {
                    MessageDlg.Show(this, string.Format(Resources.EditOptimizationLibraryDlg_ValidateOptimizationList_The_optimization_with_sequence__0___charge__1___fragment_ion__2__and_product_charge__3__appears_in_the__4__table_more_than_once_,
                                                        seqModified, optimization.Adduct, optimization.FragmentIon, optimization.ProductAdduct, tableName));
                    return(false);
                }
                keySet.Add(optimization.Key);
            }

            return(true);
        }
Exemplo n.º 2
0
        public EditOptimizationLibraryDlg(SrmDocument document, OptimizationLibrary lib, IEnumerable <OptimizationLibrary> existing)
        {
            _existing = existing;
            _document = document;

            InitializeComponent();

            Icon = Resources.Skyline;

            _gridViewLibraryDriver = new LibraryGridViewDriver(gridViewLibrary, bindingSourceLibrary,
                                                               new SortableBindingList <DbOptimization>(), this, document);

            if (lib != null)
            {
                textName.Text = _editingName = lib.Name;
                OpenDatabase(lib.DatabasePath);
            }

            comboType.Items.Add(ExportOptimize.CE);
            comboType.Items.Add(ExportOptimize.COV);
            comboType.SelectedIndex = 0;
        }