次の方法で共有


ITextView2.TryGetTextViewLines(ITextViewLineCollection) Method

Definition

Attempts to get a read-only list of the ITextViewLine objects rendered in this view.

public:
 bool TryGetTextViewLines([Runtime::InteropServices::Out] Microsoft::VisualStudio::Text::Editor::ITextViewLineCollection ^ % textViewLines);
public bool TryGetTextViewLines (out Microsoft.VisualStudio.Text.Editor.ITextViewLineCollection textViewLines);
abstract member TryGetTextViewLines : ITextViewLineCollection -> bool
Public Function TryGetTextViewLines (ByRef textViewLines As ITextViewLineCollection) As Boolean

Parameters

textViewLines
ITextViewLineCollection

Returns out the ITextViewLineCollection requested.

Returns

True if succeeded, false otherwise.

Remarks

This list will be dense. That is, all characters between the first character of the first ITextViewLine through the last character of the last ITextViewLine will be represented in one of the ITextViewLine objects, except when the layout of the ITextViewLine objects is in progress.

ITextViewLine objects are disjoint. That is, a given character is part of only one ITextViewLine.

The ITextViewLine objects are sorted by the index of their first character.

Some of the ITextViewLine objects may not be visible, and all ITextViewLine objects will be disposed of when the view recomputes its layout.

This list is occasionally not available due to layouts or other events, and callers should be prepared to handle a failure.

Applies to