当前位置: 首页>>代码示例>>C#>>正文


C# Difference.GetHvoOfFirstSection方法代码示例

本文整理汇总了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);
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:56,代码来源:DiffDialog.cs


注:本文中的Difference.GetHvoOfFirstSection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。