Class
TextSnapshot

Represents a snapshot of the text.

Definition

Namespace:Telerik.Windows.SyntaxEditor.Core.Text

Assembly:Telerik.Windows.SyntaxEditor.Core.dll

Syntax:

cs-api-definition
public class TextSnapshot

Inheritance: objectTextSnapshot

Properties

Length

Gets the length of the text.

Declaration

cs-api-definition
public int Length { get; }

Property Value

int

LineCount

Gets the count of the lines.

Declaration

cs-api-definition
public int LineCount { get; }

Property Value

int

Lines

Gets the lines.

Declaration

cs-api-definition
public IEnumerable<TextSnapshotLine> Lines { get; }

Property Value

IEnumerable<TextSnapshotLine>

Span

Gets a span from 0 to the Length.

Declaration

cs-api-definition
public Span Span { get; }

Property Value

Span

TextDocument

Gets the text document.

Declaration

cs-api-definition
public TextDocument TextDocument { get; }

Property Value

TextDocument

Version

Gets the version of the snapshot.

Declaration

cs-api-definition
public TextVersion Version { get; }

Property Value

TextVersion

this[int]

Gets an index-based char.

Declaration

cs-api-definition
public char this[int position] { get; }

Parameters

position

int

Property Value

char

Methods

GetLineFromLineNumber(int)

Gets the snapshot line number from the line number.

Declaration

cs-api-definition
public TextSnapshotLine GetLineFromLineNumber(int lineNumber)

Parameters

lineNumber

int

Returns

TextSnapshotLine

GetLineFromPosition(int)

Gets the snapshot line number from the given position.

Declaration

cs-api-definition
public TextSnapshotLine GetLineFromPosition(int position)

Parameters

position

int

Returns

TextSnapshotLine

GetLineNumberFromPosition(int)

Gets the line number from the given position.

Declaration

cs-api-definition
public int GetLineNumberFromPosition(int position)

Parameters

position

int

Returns

int

GetText()

Gets the text of this snapshot instance.

Declaration

cs-api-definition
public string GetText()

Returns

string

GetText(Span)

Gets the text of the given span.

Declaration

cs-api-definition
public string GetText(Span span)

Parameters

span

Span

Returns

string