private static bool SetAnnotationValue(EditNoteDlg editNoteDlg, String annotationName, Object value) { for (int i = 0; i < editNoteDlg.DataGridView.Rows.Count; i++) { var row = editNoteDlg.DataGridView.Rows[i]; if (!annotationName.Equals(row.Cells[0].Value)) { continue; } row.Cells[1].Value = value; return(true); } return(false); }
private static void SetAnnotationValue(EditNoteDlg editNoteDlg, String annotationName, String value) { for (int i = 0; i < editNoteDlg.DataGridView.Rows.Count; i++) { var row = editNoteDlg.DataGridView.Rows[i]; if (!annotationName.Equals(row.Cells[0].Value)) { continue; } row.Cells[1].Value = value; return; } throw new ArgumentException("Could not find annotation " + annotationName); }