In This Article

ITextSnapshotLine Interface

Provides the base requirements for a line in an ITextSnapshot.

public interface ITextSnapshotLine : ITextRangeProvider

Properties

EndOffset

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

int EndOffset { get; }

Property Value

int:

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

EndOffsetIncludingLineTerminator

Gets 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:

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

FirstNonWhitespaceCharacterOffset

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

int FirstNonWhitespaceCharacterOffset { get; }

Property Value

int:

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

Remarks

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

IndentAmount

Gets or sets the indent amount, in columns, of the line.

int IndentAmount { get; set; }

Property Value

int:

The indent amount, in columns, of the line.

Index

Gets the index of the line within the ITextSnapshot.

int Index { get; }

Property Value

int:

The index of the line within the ITextSnapshot.

IsLastLine

Gets 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

Gets the length of the line, excluding the line terminator.

int Length { get; }

Property Value

int:

The length of the line, excluding the line terminator.

Snapshot

Gets the ITextSnapshot that contains the line.

ITextSnapshot Snapshot { get; }

Property Value

ITextSnapshot:

The ITextSnapshot that contains the line.

SnapshotRange

Gets a TextSnapshotRange that contains the text of the line, excluding the line terminator.

TextSnapshotRange SnapshotRange { get; }

Property Value

TextSnapshotRange:

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

StartOffset

Gets the offset at which the line starts.

int StartOffset { get; }

Property Value

int:

The offset at which the line starts.

Text

Gets the text of the line, excluding the line terminator.

string Text { get; }

Property Value

string:

The text of the line, excluding the line terminator.

TextRangeIncludingLineTerminator

Gets 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:

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

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:

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

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