New to Telerik UI for WPFStart a free 30-day trial

Represents a snapshot of the text.

Definition

Namespace:Telerik.Windows.SyntaxEditor.Core.Text

Assembly:Telerik.Windows.SyntaxEditor.Core.dll

Syntax:

C#
public class TextSnapshot

Inheritance: objectTextSnapshot

Properties

Gets the length of the text.

C#
public int Length { get; }

Gets the count of the lines.

C#
public int LineCount { get; }

Gets the lines.

C#
public IEnumerable<TextSnapshotLine> Lines { get; }

Gets a span from 0 to the Length.

C#
public Span Span { get; }

Gets the text document.

C#
public TextDocument TextDocument { get; }

Gets an index-based char.

C#
public char this[int position] { get; }
Parameters:positionint

Gets the version of the snapshot.

C#
public TextVersion Version { get; }

Methods

Gets the snapshot line number from the line number.

C#
public TextSnapshotLine GetLineFromLineNumber(int lineNumber)
Parameters:lineNumberintReturns:

TextSnapshotLine

Gets the snapshot line number from the given position.

C#
public TextSnapshotLine GetLineFromPosition(int position)
Parameters:positionintReturns:

TextSnapshotLine

Gets the line number from the given position.

C#
public int GetLineNumberFromPosition(int position)
Parameters:positionintReturns:

int

Gets the text of this snapshot instance.

C#
public string GetText()
Returns:

string

Gets the text of the given span.

C#
public string GetText(Span span)
Parameters:spanSpanReturns:

string