public void GetIsBlockScripture_ScriptureBlock_ReturnsTrue() { m_model.Mode = BlocksToDisplay.AllScripture; FindRefInMark(1, 12); Assert.IsTrue(m_model.GetIsBlockScripture(m_model.CurrentBlock)); Assert.IsTrue(m_model.GetIsBlockScripture(m_model.CurrentBlockIndexInBook)); }
protected override void OnSelectionChanged(EventArgs e) { if (m_updatingContext) { return; } if (SelectedRows.Count > 0 && m_viewModel.GetIsBlockScripture(SelectedRows[0].Index)) { m_viewModel.CurrentBlockIndexInBook = SelectedRows[0].Index; } base.OnSelectionChanged(e); }
protected override void OnSelectionChanged(EventArgs e) { if (m_updatingContext) { return; } // NOTE: The use of m_betweenMouseDownAndMouseUp is needed because it is commonly the case that clicking (MouseDown) a // row to select it will cause that row (and maybe other adjected rows) to be selected and the scrolling will adjust to // position them at the top of the view (for better "rainbow" alignment). Since the scrolling happens while the mouse is // still down, the normal behavior of the data grid view, which is in multiple-row select mode, is to think it needs to // adjust anew the selected row(s). But this causes subsequent row(s) to get selected instead, and that is bad. if (SelectedRows.Count > 0 && m_viewModel.GetIsBlockScripture(SelectedRows[0].Index) && !m_betweenMouseDownAndMouseUp) { m_viewModel.CurrentBlockIndexInBook = SelectedRows[0].Index; } base.OnSelectionChanged(e); }