IWpfTextViewLineCollection Interface

 

Allows the ITextView to access the view's collection of ITextViewLine objects. You can use the TextViewLines property to get an instance of the ITextViewLineCollection interface.

Namespace:   Microsoft.VisualStudio.Text.Editor
Assembly:  Microsoft.VisualStudio.Text.UI.Wpf (in Microsoft.VisualStudio.Text.UI.Wpf.dll)

public interface IWpfTextViewLineCollection : ITextViewLineCollection, 
	IList<ITextViewLine>, ICollection<ITextViewLine>, IEnumerable<ITextViewLine>, 
	IEnumerable

NameDescription
System_CAPS_pubpropertyCount

(Inherited from ICollection<T>.)

System_CAPS_pubpropertyFirstVisibleLine

Gets the first line that is not completely hidden.

System_CAPS_pubpropertyFormattedSpan

Gets the span of text contained in this ITextViewLine collection.(Inherited from ITextViewLineCollection.)

System_CAPS_pubpropertyIsReadOnly

(Inherited from ICollection<T>.)

System_CAPS_pubpropertyIsValid

Determines whether this ITextViewLineCollection object is still valid.(Inherited from ITextViewLineCollection.)

System_CAPS_pubpropertyItem[Int32]

Get the IWpfTextViewLine at index.

System_CAPS_pubpropertyLastVisibleLine

Gets the last line that is not completely hidden.

System_CAPS_pubpropertyWpfTextViewLines

Gets a collection of IWpfTextViewLine objects.

NameDescription
System_CAPS_pubmethodAdd(T)

(Inherited from ICollection<T>.)

System_CAPS_pubmethodClear()

(Inherited from ICollection<T>.)

System_CAPS_pubmethodContains(T)

(Inherited from ICollection<T>.)

System_CAPS_pubmethodContainsBufferPosition(SnapshotPoint)

Determines whether the specified buffer position is contained by any of the ITextViewLine objects in the collection.(Inherited from ITextViewLineCollection.)

System_CAPS_pubmethodCopyTo(T[], Int32)

(Inherited from ICollection<T>.)

System_CAPS_pubmethodGetCharacterBounds(SnapshotPoint)

Gets the text bounds of the specified text buffer position.(Inherited from ITextViewLineCollection.)

System_CAPS_pubmethodGetEnumerator()

(Inherited from IEnumerable<T>.)

System_CAPS_pubmethodGetIndexOfTextLine(ITextViewLine)

Gets the index in the text lines of the given text view line.(Inherited from ITextViewLineCollection.)

System_CAPS_pubmethodGetLineMarkerGeometry(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.

System_CAPS_pubmethodGetLineMarkerGeometry(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.

System_CAPS_pubmethodGetMarkerGeometry(SnapshotSpan)

Creates a marker geometry for the specified snapshot span.

System_CAPS_pubmethodGetMarkerGeometry(SnapshotSpan, Boolean, Thickness)

Creates a marker geometry for the specified snapshot span.

System_CAPS_pubmethodGetNormalizedTextBounds(SnapshotSpan)

Gets a collection of TextBounds structures for the text that corresponds to the given span.(Inherited from ITextViewLineCollection.)

System_CAPS_pubmethodGetTextElementSpan(SnapshotPoint)

Gets the span whose text element span contains the given buffer position.(Inherited from ITextViewLineCollection.)

System_CAPS_pubmethodGetTextMarkerGeometry(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.

System_CAPS_pubmethodGetTextMarkerGeometry(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.

System_CAPS_pubmethodGetTextViewLineContainingBufferPosition(SnapshotPoint)

Gets the IWpfTextViewLine that contains the specified text buffer position.

System_CAPS_pubmethodGetTextViewLineContainingYCoordinate(Double)

Gets the ITextViewLine that contains the specified y-coordinate.(Inherited from ITextViewLineCollection.)

System_CAPS_pubmethodGetTextViewLinesIntersectingSpan(SnapshotSpan)

Gets all of the ITextViewLine objects that intersect bufferSpan.(Inherited from ITextViewLineCollection.)

System_CAPS_pubmethodIndexOf(T)

(Inherited from IList<T>.)

System_CAPS_pubmethodInsert(Int32, T)

(Inherited from IList<T>.)

System_CAPS_pubmethodIntersectsBufferSpan(SnapshotSpan)

Determines whether the specified buffer span intersects any of the ITextViewLine objects in the collection.(Inherited from ITextViewLineCollection.)

System_CAPS_pubmethodRemove(T)

(Inherited from ICollection<T>.)

System_CAPS_pubmethodRemoveAt(Int32)

(Inherited from IList<T>.)

The ITextView disposes its ITextViewLineCollection and all the ITextViewLine objects 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 view.ViewportTop property to change. For example, scrolling down one line will not translate any of the visible lines.

Instead it will simply change the P:Microsoft.VisualStudio.Text.Formatting.ITextView.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.

Return to top
Show: