public bool TransitionListRowsContainProtein(Predicate<string> found) { var transitionListRows = new DataGridViewRow[gridViewTransitionList.RowCount]; gridViewPeptides.Rows.CopyTo(transitionListRows, 0); return transitionListRows.Take(gridViewTransitionList.RowCount-1).Contains(row => { var protein = row.Cells[colTransitionProteinName.Index].Value; return found(protein != null ? protein.ToString() : null); }); }
public bool PeptideRowsContainPeptide(Predicate<string> found) { var peptideRows = new DataGridViewRow[gridViewPeptides.RowCount]; gridViewPeptides.Rows.CopyTo(peptideRows, 0); return peptideRows.Take(gridViewPeptides.RowCount-1).Contains(row => { var peptide = row.Cells[colPeptideSequence.Index].Value; return found(peptide != null ? peptide.ToString() : null); }); }