Condividi tramite


ITextSnapshot.GetLineFromPosition Method

Gets an ITextSnapshotLine for a line at the given position.

Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

Syntax

'Declaration
Function GetLineFromPosition ( _
    position As Integer _
) As ITextSnapshotLine
ITextSnapshotLine GetLineFromPosition(
    int position
)
ITextSnapshotLine^ GetLineFromPosition(
    int position
)
abstract GetLineFromPosition : 
        position:int -> ITextSnapshotLine
function GetLineFromPosition(
    position : int
) : ITextSnapshotLine

Parameters

  • position
    Type: Int32

    The position.

Return Value

Type: Microsoft.VisualStudio.Text.ITextSnapshotLine
A non-null ITextSnapshotLine.

Exceptions

Exception Condition
ArgumentOutOfRangeException

position is less than zero or greater than the length of the line.

.NET Framework Security

See Also

Reference

ITextSnapshot Interface

Microsoft.VisualStudio.Text Namespace