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.
EndOffsetIncludingLineTerminator
The offset at which the line ends, including the line terminator if there is a hard line break on the line.
FirstNonWhitespaceCharacterOffset
The offset of the first non-whitespace character in the line.
int FirstNonWhitespaceCharacterOffset { get; }
Property Value
Remarks
If no non-whitespace character is found, the value of EndOffset is returned.
IndentAmount
The indent amount, in columns, of the line.
Index
The index of the line within the ITextSnapshot.
IsLastLine
Indicates whether the line contains the last offset of the document.
bool IsLastLine { get; }
Property Value
- bool:
trueif the line contains the last offset of the document; otherwise,false.
Length
The length of the line, excluding the line terminator.
LineTerminator
The LineTerminator that ends the line, when the line is not the last line in the document.
Snapshot
The ITextSnapshot that contains the line.
SnapshotRange
A TextSnapshotRange that contains the text of the line, excluding the line terminator.
StartOffset
The offset at which the line starts.
Text
The text of the line, excluding the line terminator.
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.
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:
trueif 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.
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:
trueif 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:
trueif the offset starts the line; otherwise,false.