TextSpanHelper.Normalize Method
Pins the ends of the given span to the actual line lengths in the given text buffer.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Syntax
'Declaration
Public Shared Sub Normalize ( _
ByRef span As TextSpan, _
textLines As IVsTextLines _
)
public static void Normalize(
ref TextSpan span,
IVsTextLines textLines
)
public:
static void Normalize(
TextSpan% span,
IVsTextLines^ textLines
)
static member Normalize :
span:TextSpan byref *
textLines:IVsTextLines -> unit
public static function Normalize(
span : TextSpan,
textLines : IVsTextLines
)
Parameters
span
Type: Microsoft.VisualStudio.TextManager.Interop.TextSpan%[in] The TextSpan object to be modified. This object can be null.
textLines
Type: Microsoft.VisualStudio.TextManager.Interop.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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.