ITextSnapshot 接口

定义

为包含 Unicode 字符序列的的不可变快照提供读取访问权限 ITextBufferProvides read access to an immutable snapshot of a ITextBuffer containing a sequence of Unicode characters. 序列中的第一个字符的索引为零。The first character in the sequence has index zero.

public interface class ITextSnapshot
public interface class ITextSnapshot
__interface ITextSnapshot
public interface ITextSnapshot
type ITextSnapshot = interface
Public Interface ITextSnapshot
派生

注解

有关文本快照的详细信息,请参阅 编辑器内的 "文本模型和文本视图"。For more information about text snapshots, see "A Closer Look at the Text Model and the Text View" in Inside the Editor.

序列中的第一个字符的索引为零。The first character in the sequence has index zero.

属性

ContentType

IContentType TextBuffer 此快照为当前快照时的。The IContentType of the TextBuffer when this snapshot was current.

Item[Int32]

获取位于指定位置的单个字符。Gets a single character at the specified position.

Length

获取快照中包含的 UTF-16 字符数。Gets the number of UTF-16 characters contained in the snapshot.

LineCount

获取快照中的正数。Gets the positive number of lines in the snapshot. 其为零的快照被 Length 视为具有一行。A snapshot whose Length is zero is considered to have one line.

Lines

快照中的行集的枚举器。An enumerator for the set of lines in the snapshot.

TextBuffer

ITextBuffer此为快照的。The ITextBuffer of which this is a snapshot.

Version

此表示的的版本 ITextBuffer ITextSnapshotThe version of the ITextBuffer that this ITextSnapshot represents.

方法

CopyTo(Int32, Char[], Int32, Int32)

将一定范围的文本复制到字符数组。Copies a range of text to a character array.

CreateTrackingPoint(Int32, PointTrackingMode)

ITrackingPoint根据此快照创建一个。Creates a ITrackingPoint against this snapshot.

CreateTrackingPoint(Int32, PointTrackingMode, TrackingFidelityMode)

ITrackingPoint根据此快照创建一个。Creates a ITrackingPoint against this snapshot.

CreateTrackingSpan(Int32, Int32, SpanTrackingMode)

ITrackingSpan根据此快照创建一个。Creates a ITrackingSpan against this snapshot.

CreateTrackingSpan(Int32, Int32, SpanTrackingMode, TrackingFidelityMode)

ITrackingSpan根据此快照创建一个。Creates a ITrackingSpan against this snapshot.

CreateTrackingSpan(Span, SpanTrackingMode)

ITrackingSpan根据此快照创建一个。Creates a ITrackingSpan against this snapshot.

CreateTrackingSpan(Span, SpanTrackingMode, TrackingFidelityMode)

ITrackingSpan根据此快照创建一个。Creates a ITrackingSpan against this snapshot.

GetLineFromLineNumber(Int32)

获取 ITextSnapshotLine 给定行号的。Gets an ITextSnapshotLine for the given line number.

GetLineFromPosition(Int32)

获取 ITextSnapshotLine 给定位置处的行的。Gets an ITextSnapshotLine for a line at the given position.

GetLineNumberFromPosition(Int32)

获取包含位于指定位置的字符的行号。Gets the number of the line that contains the character at the specified position.

GetText()

获取快照中的所有文本。Gets all the text in the snapshot.

GetText(Int32, Int32)

获取从开始、长度等于的的快照中的文本 startIndex lengthGets text from the snapshot starting at startIndex and having length equal to length.

GetText(Span)

从位于跨度开头开始、长度等于范围长度的快照中获取文本。Gets text from the snapshot starting at the beginning of the span and having length equal to the length of the span.

ToCharArray(Int32, Int32)

将文本范围转换为字符数组。Converts a range of text to a character array.

Write(TextWriter)

写入快照的内容。Writes the contents of the snapshot.

Write(TextWriter, Span)

写入快照内容的子字符串。Writes a substring of the contents of the snapshot.

适用于