IWpfTextViewLineCollection Interface

Definition

Allows the ITextView to access the view's collection of ITextViewLine objects. The TextViewLines property on the ITextView is used to get an instance of the ITextViewLineCollection interface.

public interface class IWpfTextViewLineCollection : Microsoft::VisualStudio::Text::Editor::ITextViewLineCollection, System::Collections::Generic::ICollection<Microsoft::VisualStudio::Text::Formatting::ITextViewLine ^>, System::Collections::Generic::IEnumerable<Microsoft::VisualStudio::Text::Formatting::ITextViewLine ^>, System::Collections::Generic::IList<Microsoft::VisualStudio::Text::Formatting::ITextViewLine ^>
public interface IWpfTextViewLineCollection : Microsoft.VisualStudio.Text.Editor.ITextViewLineCollection, System.Collections.Generic.ICollection<Microsoft.VisualStudio.Text.Formatting.ITextViewLine>, System.Collections.Generic.IEnumerable<Microsoft.VisualStudio.Text.Formatting.ITextViewLine>, System.Collections.Generic.IList<Microsoft.VisualStudio.Text.Formatting.ITextViewLine>
type IWpfTextViewLineCollection = interface
    interface ITextViewLineCollection
    interface IList<ITextViewLine>
    interface ICollection<ITextViewLine>
    interface seq<ITextViewLine>
    interface IEnumerable
Public Interface IWpfTextViewLineCollection
Implements ICollection(Of ITextViewLine), IEnumerable(Of ITextViewLine), IList(Of ITextViewLine), ITextViewLineCollection
Implements

Remarks

The ITextView disposes its ITextViewLineCollection and all the ITextViewLines it contains every time it generates a new layout.

Most properties and parameters that are doubles correspond to coordinates or distances in the text rendering coordinate system. In this coordinate system, x = 0.0 corresponds to the left edge of the drawing surface onto which text is rendered (x = view.ViewportLeft corresponds to the left edge of the viewport), and y = view.ViewportTop corresponds to the top edge of the viewport. The x-coordinate increases from left to right, and the y-coordinate increases from top to bottom.

The horizontal and vertical axes of the view behave differently. When the text in the view is formatted, only the visible lines are formatted. As a result, a viewport cannot be scrolled horizontally and vertically in the same way.

A viewport is scrolled horizontally by changing the left coordinate of the viewport so that it moves with respect to the drawing surface.

A view can be scrolled vertically only by performing a new layout.

Doing a layout in the view may cause the ViewportTop property of the view to change. For example, scrolling down one line will not translate any of the visible lines. Instead it will simply change the view's ViewportTop property (causing the lines to move on the screen even though their y-coordinates have not changed).

Distances in the text rendering coordinate system correspond to logical pixels. If the text rendering surface is displayed without any scaling transform, then 1 unit in the text rendering coordinate system corresponds to one pixel on the display.

Properties

FirstVisibleLine

Gets the first line that is not completely hidden.

FormattedSpan

Gets the span of text contained in this ITextViewLine collection.

(Inherited from ITextViewLineCollection)
IsValid

Determines whether this ITextViewLineCollection object is still valid.

(Inherited from ITextViewLineCollection)
Item[Int32]

Get the IWpfTextViewLine at index.

LastVisibleLine

Gets the last line that is not completely hidden.

WpfTextViewLines

Gets a collection of IWpfTextViewLine objects.

Methods

ContainsBufferPosition(SnapshotPoint)

Determines whether the specified buffer position is contained by any of the ITextViewLine objects in the collection.

(Inherited from ITextViewLineCollection)
GetCharacterBounds(SnapshotPoint)

Gets the text bounds of the specified text buffer position.

(Inherited from ITextViewLineCollection)
GetIndexOfTextLine(ITextViewLine)

Gets the index in the text lines of the given text view line.

(Inherited from ITextViewLineCollection)
GetLineMarkerGeometry(SnapshotSpan)

Gets the text marker geometry for the specified range of text in the buffer by using a polygonal approximation algorithm to calculate the outline path of the text regions.

GetLineMarkerGeometry(SnapshotSpan, Boolean, Thickness)

Gets the text marker geometry for the specified range of text in the buffer by using a polygonal approximation algorithm to calculate the outline path of the text regions.

GetMarkerGeometry(SnapshotSpan)

Creates a marker geometry for the provided bufferSpan. If the provided bufferSpan extends beyond one line, then GetLineMarkerGeometry(SnapshotSpan) is used to calculate the marker geometry, otherwise this method uses GetTextMarkerGeometry(SnapshotSpan) to construct the geometry.

GetMarkerGeometry(SnapshotSpan, Boolean, Thickness)

Creates a marker geometry for the provided bufferSpan. If the provided bufferSpan extends beyond one line, then GetLineMarkerGeometry(SnapshotSpan, Boolean, Thickness) is used to calculate the marker geometry, otherwise this method uses GetTextMarkerGeometry(SnapshotSpan, Boolean, Thickness) to construct the geometry.

GetNormalizedTextBounds(SnapshotSpan)

Gets a collection of TextBounds structures for the text that corresponds to the given span.

(Inherited from ITextViewLineCollection)
GetTextElementSpan(SnapshotPoint)

Gets the span whose text element span contains the given buffer position.

(Inherited from ITextViewLineCollection)
GetTextMarkerGeometry(SnapshotSpan)

Gets the text marker geometry for the specified range of text in the buffer by using a polygonal approximation algorithm to calculate the outline path of the text regions.

GetTextMarkerGeometry(SnapshotSpan, Boolean, Thickness)

Gets the text marker geometry for the specified range of text in the buffer by using a polygonal approximation algorithm to calculate the outline path of the text regions.

GetTextViewLineContainingBufferPosition(SnapshotPoint)

Gets the IWpfTextViewLine that contains the specified text buffer position.

GetTextViewLineContainingYCoordinate(Double)

Gets the ITextViewLine that contains the specified y-coordinate.

(Inherited from ITextViewLineCollection)
GetTextViewLinesIntersectingSpan(SnapshotSpan)

Gets all of the ITextViewLine objects that intersect bufferSpan.

(Inherited from ITextViewLineCollection)
IntersectsBufferSpan(SnapshotSpan)

Detrmines whether the specified buffer span intersects any of the ITextViewLine objects in the collection.

(Inherited from ITextViewLineCollection)

Extension Methods

EmptyIfNull<T>(IEnumerable<T>)

Applies to