本文整理汇总了C#中TextManager.GetSecondaryBuffer方法的典型用法代码示例。如果您正苦于以下问题:C# TextManager.GetSecondaryBuffer方法的具体用法?C# TextManager.GetSecondaryBuffer怎么用?C# TextManager.GetSecondaryBuffer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextManager
的用法示例。
在下文中一共展示了TextManager.GetSecondaryBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryFixUpNearestVisibleSpan
private static bool TryFixUpNearestVisibleSpan(
TextManager.Interop.IVsContainedLanguageHost containedLanguageHost, TextManager.Interop.IVsTextBufferCoordinator bufferCoordinator,
int originalLine, int originalColumn, out LinePosition adjustedPosition)
{
// GetNearestVisibleToken gives us the position right at the end of visible span.
// Move the position one position to the left so that squiggle can show up on last token.
if (originalColumn > 1)
{
adjustedPosition = new LinePosition(originalLine, originalColumn - 1);
return true;
}
if (originalLine > 1)
{
TextManager.Interop.IVsTextLines secondaryBuffer;
int length;
if (VSConstants.S_OK == bufferCoordinator.GetSecondaryBuffer(out secondaryBuffer) &&
VSConstants.S_OK == secondaryBuffer.GetLengthOfLine(originalLine - 1, out length))
{
adjustedPosition = new LinePosition(originalLine - 1, length);
return true;
}
}
adjustedPosition = LinePosition.Zero;
return false;
}