Freigeben über


SnapshotSpan Constructor (ITextSnapshot, Int32, Int32)

Initializes a new instance of a SnapshotSpan with the specified snapshot, start point, and length.

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

Syntax

'Declaration
Public Sub New ( _
    snapshot As ITextSnapshot, _
    start As Integer, _
    length As Integer _
)
public SnapshotSpan(
    ITextSnapshot snapshot,
    int start,
    int length
)
public:
SnapshotSpan(
    ITextSnapshot^ snapshot, 
    int start, 
    int length
)
new : 
        snapshot:ITextSnapshot * 
        start:int * 
        length:int -> SnapshotSpan
public function SnapshotSpan(
    snapshot : ITextSnapshot, 
    start : int, 
    length : int
)

Parameters

  • start
    Type: Int32

    The starting point of the snapshot span.

  • length
    Type: Int32

    The length of the snapshot span.

Exceptions

Exception Condition
ArgumentNullException

snapshot is nulla null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

start is negative or greater than snapshot.Length, or length is negative, or start + length is greater than snapshot.Length.

.NET Framework Security

See Also

Reference

SnapshotSpan Structure

SnapshotSpan Overload

Microsoft.VisualStudio.Text Namespace