本文整理汇总了C#中Difference.GetHvoOfFirstSection方法的典型用法代码示例。如果您正苦于以下问题:C# Difference.GetHvoOfFirstSection方法的具体用法?C# Difference.GetHvoOfFirstSection怎么用?C# Difference.GetHvoOfFirstSection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Difference
的用法示例。
在下文中一共展示了Difference.GetHvoOfFirstSection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScrollToDiff
/// ------------------------------------------------------------------------------------
/// <summary>
/// Find the difference in both views and bring it into view.
/// </summary>
/// <param name="diff">difference to seek</param>
/// ------------------------------------------------------------------------------------
internal void ScrollToDiff(Difference diff)
{
CheckDisposed();
// Things aren't yet fully initialized, so quit and we'll get back here later.
if (diff == null ||
m_diffViewWrapper.CurrentDiffView == null ||
m_diffViewWrapper.RevisionDiffView == null)
return;
if (diff.DiffType == DifferenceType.SectionAddedToCurrent ||
diff.DiffType == DifferenceType.SectionHeadAddedToCurrent)
{
// For Section*AddedToCurrent diff, the Current pane will highlight the
// entire section (or head), the Revision pane will show a paragraph location.
ScrSection sectionCurr = new ScrSection(m_cache, diff.GetHvoOfFirstSection(false));
m_diffViewWrapper.CurrentDiffView.ScrollToSectionDiff(sectionCurr.IndexInBook);
m_diffViewWrapper.RevisionDiffView.ScrollToParaDiff(diff.HvoRev, diff.IchMinRev);
}
else if (diff.DiffType == DifferenceType.SectionMissingInCurrent ||
diff.DiffType == DifferenceType.SectionHeadMissingInCurrent)
{
// For Section*MissingInCurrent diff, the Revsion pane will highlight the
// entire section.
ScrSection sectionRev = new ScrSection(m_cache, diff.GetHvoOfFirstSection(true));
m_diffViewWrapper.RevisionDiffView.ScrollToSectionDiff(sectionRev.IndexInBook);
if (diff.DiffType == DifferenceType.SectionMissingInCurrent)
{
// Since the para hvo for the current may have been changed by deleting
// sections, we will find a new insert index every time, and scroll to that section
m_diffViewWrapper.CurrentDiffView.ScrollToSectionDiff(
m_bookMerger.GetCurrSectionInsertIndex(diff.RefEnd));
}
else if (diff.DiffType == DifferenceType.SectionHeadMissingInCurrent)
{
// the Current pane will show a paragraph location.
m_diffViewWrapper.CurrentDiffView.ScrollToParaDiff(diff.HvoCurr, diff.IchMinCurr);
}
}
else
{
// Paragraph Diff case.
// TODO: For ParagraphMissingInCurrent differences: Someday when we can
// show a paragraph insertion point, we will need to call the book merger to get
// the correct insertion point because it's possible that the hvoCurr paragraph
// may have been deleted, e.g. m_bookMerger.GetCurrParaInsertIndex(diff)
m_diffViewWrapper.CurrentDiffView.ScrollToParaDiff(diff.HvoCurr, diff.IchMinCurr);
m_diffViewWrapper.RevisionDiffView.ScrollToParaDiff(diff.HvoRev, diff.IchMinRev);
}
}