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

Int32:

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

Int32:

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

Int32:

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

Int32:

The indent amount, in columns, of the line.

Index

Gets the index of the line within the ITextSnapshot.

int Index { get; }

Property Value

Int32:

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

Boolean:

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

Int32:

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

Int32:

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(Int32)

Returns whether the line contains the specified offset.

bool Contains(int offset)
Parameter Type Description
offset Int32

The offset to check.

Returns

Boolean:

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(Int32)

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

int GetIndentAmountBefore(int offset)
Parameter Type Description
offset Int32

Returns

Int32:

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

IsLineEnd(Int32)

Returns whether the specified offset ends the line.

bool IsLineEnd(int offset)
Parameter Type Description
offset Int32

The offset to check.

Returns

Boolean:

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

IsLineStart(Int32)

Returns whether the specified offset starts the line.

bool IsLineStart(int offset)
Parameter Type Description
offset Int32

The offset to check.

Returns

Boolean:

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

Inherited Members