Version

TextDocumentSnapshot Overview

Topic Overview

Purpose

This topic provides an overview of the TextDocumentSnapshot object’s properties and methods.

Introduction

TextDocumentSnapshot summary

The TextDocumentSnaphot represents the entire state of the document through each of its versions. Making any changes to the document creates a new snapshot. Each snapshot being thread safe and immutable.

TextDocumentSnapshot Read-Only Properties

Read-Only Property List

Property Description

Document

This property returns the associated TextDocument.

Version

This property returns a TextDocumentVersion object that exposes a version number, a reference to the next TextDocumentVersion (if it is not the current snapshot) along with a list of the changes made to the version to get to the next version

Length

This property returns the length of the TextDocument, in characters.

LineCount

This property returns the number of lines in the TextDocument.

TokenCount

This property returns the number of tokens in the TextDocument.

TextDocumentSnapshot Methods

Methods List

Method Description

CreateScanner

This property creates and returns an instance of a TextDocumentSnapshotScanner targeting the TextDocumentSnapshot that created it.

GetLines

This property retrieves an enumerator of Lines in the document.

GetTokens

This property retrieves an enumerator of Tokens in the document.

LineFromIndex

This property retrieves a SnapshotLineInfo object for the line of text at a zero-based index.

LineFromOffset

This property retrieves a SnapshotLineInfo object for the line of text containing the character at the specified offset.

TokenFromOffset

This property retrieves the Token object containing the character at the specified offset.

WordFromOffset

This property retrieves the Word object containing the character at the specified offset.

Related Content

Topics

The following topic provides additional information related to this topic.

Topic Purpose

This topic describes the Infragistics Syntax Parsing Engine’s main class, TextDocument, and contains links to topics outlining its most important methods, events and properties.

This topic provides an overview of the TextDocumentSnapshotScanner object’s properties and methods.