protected override void HandleCurrentBlockChanged() { if (m_inHandleCurrentBlockChanged) { return; } m_inHandleCurrentBlockChanged = true; if (CharacterVerseData.IsCharacterExtraBiblical(CurrentBlock.CharacterId)) { throw new InvalidOperationException("Cannot attempt to match an extra-biblical block to a reference text."); } if (AttemptRefBlockMatchup) { if (CurrentReferenceTextMatchup == null || !CurrentReferenceTextMatchup.IncludesBlock(CurrentBlock)) { SetBlockMatchupForCurrentVerse(); } else { CurrentReferenceTextMatchup?.ChangeAnchor(CurrentBlock); } } base.HandleCurrentBlockChanged(); m_inHandleCurrentBlockChanged = false; }
protected override void HandleCurrentBlockChanged() { if (m_inHandleCurrentBlockChanged) { return; } m_inHandleCurrentBlockChanged = true; Debug.Assert(!CharacterVerseData.IsCharacterExtraBiblical(CurrentBlock.CharacterId)); if (CurrentReferenceTextMatchup == null || !CurrentReferenceTextMatchup.IncludesBlock(CurrentBlock)) { bool doMatchup = CurrentBlock.MultiBlockQuote == MultiBlockQuote.None; if (CurrentBlock.MultiBlockQuote == MultiBlockQuote.Start) { var firstVerseInMultiBlockQuote = CurrentBlock.InitialEndVerseNumber == 0 ? CurrentBlock.InitialStartVerseNumber : CurrentBlock.InitialEndVerseNumber; var lastVerseInMultiBlockQuote = GetNthBlockInCurrentBook(GetIndicesOfQuoteContinuationBlocks(CurrentBlock).Last()).LastVerseNum; doMatchup = firstVerseInMultiBlockQuote == lastVerseInMultiBlockQuote; if (!doMatchup) { ClearBlockMatchup(); } } if (doMatchup) { SetBlockMatchupForCurrentVerse(); } } else if (CurrentReferenceTextMatchup != null) { CurrentReferenceTextMatchup.ChangeAnchor(CurrentBlock); } base.HandleCurrentBlockChanged(); m_inHandleCurrentBlockChanged = false; }