Udostępnij za pośrednictwem


TextSpanHelper.Normalize(TextSpan, IVsTextLines) Method

Definition

Pins the ends of the given span to the actual line lengths in the given text buffer.

public:
 static void Normalize(Microsoft::VisualStudio::TextManager::Interop::TextSpan % span, Microsoft::VisualStudio::TextManager::Interop::IVsTextLines ^ textLines);
public:
 static void Normalize(Microsoft::VisualStudio::TextManager::Interop::TextSpan &  span, Microsoft::VisualStudio::TextManager::Interop::IVsTextLines ^ textLines);
 static void Normalize(Microsoft::VisualStudio::TextManager::Interop::TextSpan & span, Microsoft::VisualStudio::TextManager::Interop::IVsTextLines const & textLines);
public static void Normalize (ref Microsoft.VisualStudio.TextManager.Interop.TextSpan span, Microsoft.VisualStudio.TextManager.Interop.IVsTextLines textLines);
static member Normalize : TextSpan * Microsoft.VisualStudio.TextManager.Interop.IVsTextLines -> unit
Public Shared Sub Normalize (ByRef span As TextSpan, textLines As IVsTextLines)

Parameters

span
TextSpan

[in] The TextSpan object to be modified. This object can be null.

textLines
IVsTextLines

[in] An IVsTextLines object to normalize against.

Remarks

If the buffer is null, then this method makes sure that the span is positive. Otherwise, this method modifies the span so that it is positive and lies within the boundaries that are dictated by the given text buffer. This means that the start and end points of the modified span are less than the number of lines in the buffer, the start point is less than the length of the starting line, and the end point is less than the length of the ending line. If a point is beyond the limits, it is set to the limits. For example, if the end point is greater than the number of lines, the end point is set to the index of the last line.

Applies to