/// <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);
        }