In This Article

ITextSnapshotLine Interface

Provides the base requirements for a line in an ITextSnapshot.

public interface ITextSnapshotLine : ITextRangeProvider

Properties

EndOffset

The offset at which the line ends, excluding the line terminator.

int EndOffset { get; }

Property Value

int

EndOffsetIncludingLineTerminator

The offset at which the line ends, including the line terminator if there is a hard line break on the line.

int EndOffsetIncludingLineTerminator { get; }

Property Value

int

FirstNonWhitespaceCharacterOffset

The offset of the first non-whitespace character in the line.

int FirstNonWhitespaceCharacterOffset { get; }

Property Value

int

Remarks

If no non-whitespace character is found, the value of EndOffset is returned.

IndentAmount

The indent amount, in columns, of the line.

int IndentAmount { get; set; }

Property Value

int

Index

The index of the line within the ITextSnapshot.

int Index { get; }

Property Value

int

IsLastLine

Indicates whether the line contains the last offset of the document.

bool IsLastLine { get; }

Property Value

bool:

true if the line contains the last offset of the document; otherwise, false.

Length

The length of the line, excluding the line terminator.

int Length { get; }

Property Value

int

LineTerminator

The LineTerminator that ends the line, when the line is not the last line in the document.

LineTerminator? LineTerminator { get; }

Property Value

LineTerminator?

Snapshot

The ITextSnapshot that contains the line.

ITextSnapshot Snapshot { get; }

Property Value

ITextSnapshot

SnapshotRange

A TextSnapshotRange that contains the text of the line, excluding the line terminator.

TextSnapshotRange SnapshotRange { get; }

Property Value

TextSnapshotRange

StartOffset

The offset at which the line starts.

int StartOffset { get; }

Property Value

int

Text

The text of the line, excluding the line terminator.

string Text { get; }

Property Value

string

TextRangeIncludingLineTerminator

The TextRange that indicates the text range of the line, including the line terminator if there is a hard line break on the line.

TextRange TextRangeIncludingLineTerminator { get; }

Property Value

TextRange

Methods

Contains(int)

Returns whether the line contains the specified offset.

bool Contains(int offset)
Parameter Type Description
offset int

The offset to check.

Returns

bool:

true if the line contains the offset; otherwise, false.

Remarks

This method returns false if the offset falls on the line terminator of the line.

GetIndentAmountBefore(int)

Returns indent amount, in columns, of the line before the specified offset.

int GetIndentAmountBefore(int offset)
Parameter Type Description
offset int

Returns

int

IsLineEnd(int)

Returns whether the specified offset ends the line.

bool IsLineEnd(int offset)
Parameter Type Description
offset int

The offset to check.

Returns

bool:

true if the offset ends the line; otherwise, false.

IsLineStart(int)

Returns whether the specified offset starts the line.

bool IsLineStart(int offset)
Parameter Type Description
offset int

The offset to check.

Returns

bool:

true if the offset starts the line; otherwise, false.

Inherited Members

Extension Methods