private void OnHistoryGrid_CellClick(object sender, DataGridViewCellEventArgs e) { if (!_model.DoShowRevisionChoiceControls) { if (_historyGrid.SelectedRows.Count == 1) { Revision revision = _historyGrid.SelectedRows[0].Tag as Revision; _model.SelectedRevisionChanged(revision); OnRevisionSelectionChangedEvent(new RevisionEventArgs(revision)); } return; } /* // make sure we have something reasonable * if (((e.ColumnIndex < ColumnParentRevision.Index) || (e.ColumnIndex > ColumnChildRevision.Index)) || (e.RowIndex < 0) || (e.RowIndex > _historyGrid.Rows.Count)) || return; || || if (e.ColumnIndex == ColumnParentRevision.Index) || { || _historyGrid.Rows[_parentRevisionIndex].Cells[ColumnParentRevision.Index].Value = false; || _parentRevisionIndex = e.RowIndex; || } || else if (e.ColumnIndex == ColumnChildRevision.Index) || { || _historyGrid.Rows[_childRevisionIndex].Cells[ColumnChildRevision.Index].Value = false; || _childRevisionIndex = e.RowIndex; || } || * * REVIW: I (JH) can't see how this ever worked. It appears to only send a single revision, the partent, and ignores the childRevisionIndex. * Revision rev = _historyGrid.Rows[_parentRevisionIndex].Tag as Revision; * _model.SelectedRevisionChanged(rev); */ }
private void OnHistoryGrid_CellClick(object sender, DataGridViewCellEventArgs e) { if (!_model.DoShowRevisionChoiceControls) { if (_historyGrid.SelectedRows.Count == 1) { // Mono doesn't update the selection before calling this method. // But using Rows[e.RowIndex] works on both Windows/.Net and Linux/Mono. // (See https://jira.sil.org/browse/WS-245 for a related bug report.) Revision revision = _historyGrid.Rows[e.RowIndex].Tag as Revision; _model.SelectedRevisionChanged(revision); OnRevisionSelectionChangedEvent(new RevisionEventArgs(revision)); } return; } /* // make sure we have something reasonable * if (((e.ColumnIndex < ColumnParentRevision.Index) || (e.ColumnIndex > ColumnChildRevision.Index)) || (e.RowIndex < 0) || (e.RowIndex > _historyGrid.Rows.Count)) || return; || || if (e.ColumnIndex == ColumnParentRevision.Index) || { || _historyGrid.Rows[_parentRevisionIndex].Cells[ColumnParentRevision.Index].Value = false; || _parentRevisionIndex = e.RowIndex; || } || else if (e.ColumnIndex == ColumnChildRevision.Index) || { || _historyGrid.Rows[_childRevisionIndex].Cells[ColumnChildRevision.Index].Value = false; || _childRevisionIndex = e.RowIndex; || } || * * REVIW: I (JH) can't see how this ever worked. It appears to only send a single revision, the partent, and ignores the childRevisionIndex. * Revision rev = _historyGrid.Rows[_parentRevisionIndex].Tag as Revision; * _model.SelectedRevisionChanged(rev); */ }