ITextViewLine Interface

Represents text that has been formatted for display in a text view.

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

public interface ITextViewLine

The ITextViewLine type exposes the following members.

  NameDescription
Public propertyBaselineGets the distance from the top of the text to the baseline text on the line.
Public propertyBottomGets the position of the bottom edge of this line in the text rendering coordinate system.
Public propertyChangeGets the change to this rendered textline between the current layout and the previous layout.
Public propertyDefaultLineTransformGets the default LineTransform used to render this line.
Public propertyDeltaYGets the change in the top of this rendered text line between he value of Top in the current layout and the value of Top in the previous layout.
Public propertyEndGets the position of the first character past the end of the line, excluding any line break characters.
Public propertyEndIncludingLineBreakGets the position of the first character past the end of the line, including any line break characters.
Public propertyEndOfLineWidthGets the distance from the right edge of the last character in this line to the end of the space of this line.
Public propertyExtentGets the extent of the line, excluding any line break characters.
Public propertyExtentAsMappingSpanGets the IMappingSpan that corresponds to the Extent of the line.
Public propertyExtentIncludingLineBreakGets the extent of the line, including any line break characters.
Public propertyExtentIncludingLineBreakAsMappingSpanGets the IMappingSpan that corresponds to ExtentIncludingLineBreak.
Public propertyHeightGets the distance between the top and bottom edge of this line.
Public propertyIdentityTagGets a tag that can be used to track the identity of an ITextViewLine across layouts in the view.
Public propertyIsFirstTextViewLineForSnapshotLineDetermines whether this ITextViewLine is the first line in the list of lines formatted for a particular ITextSnapshotLine.
Public propertyIsLastTextViewLineForSnapshotLineDetermines whether this ITextViewLine is the last line in the list of lines formatted for a particular ITextSnapshotLine.
Public propertyIsValidDetermines whether this text view line is still valid.
Public propertyLeftGets the position of the left edge of this line in the text rendering coordinate system.
Public propertyLengthGets the length of the line, excluding any line break characters.
Public propertyLengthIncludingLineBreakGets the length of the line, including any line break characters.
Public propertyLineBreakLengthGets the length of the line break sequence (for example, "\r\n") that appears at the end of this line.
Public propertyLineTransformGets the LineTransform used to render this line.
Public propertyRightGets the position of the right edge of this line in the text rendering coordinate system.
Public propertySnapshotGets the ITextSnapshot on which this map is based.
Public propertyStartGets the position in Snapshot of the first character in the line.
Public propertyTextBottomGets the y-coordinate of the bottom of the text in the rendered line.
Public propertyTextHeightGets the vertical distance between the top and bottom of the text in the rendered line.
Public propertyTextLeftGets the x-coordinate of the left edge of the text in the rendered line.
Public propertyTextRightGets the x-coordinate of the right edge of the text in the rendered line.
Public propertyTextTopGets the y-coordinate of the top of the text in the rendered line.
Public propertyTextWidthGets the horizontal distance between TextRight and TextLeft.
Public propertyTopGets the position of the top edge of this line in the text rendering coordinate system.
Public propertyVirtualSpaceWidthGet the width of the virtual spaces at the end of this line.
Public propertyVisibilityStateGets the visibility state of this rendered text line with respect to the top and bottom of the view.
Public propertyWidthGets the distance between the left and right edges of this line.
Top

  NameDescription
Public methodContainsBufferPositionDetermines whether the specified buffer position lies within this text line.
Public methodGetAdornmentBoundsCalculates the bounds of the specified adornment.
Public methodGetAdornmentTagsGets the adornments positioned on the line.
Public methodGetBufferPositionFromXCoordinate(Double)Gets the buffer position of the character whose character bounds contains the given x-coordinate.
Public methodGetBufferPositionFromXCoordinate(Double, Boolean)Gets the buffer position of the character whose character bounds contains the given x-coordinate.
Public methodGetCharacterBounds(SnapshotPoint)Calculates the bounds of the character at the specified buffer position.
Public methodGetCharacterBounds(VirtualSnapshotPoint)Calculates the bounds of the character at the specified buffer position.
Public methodGetExtendedCharacterBounds(SnapshotPoint)Calculates the bounds of the character at the specified buffer position, including any adjacent space-negotiating adornments.
Public methodGetExtendedCharacterBounds(VirtualSnapshotPoint)Calculates the bounds of the character at the specified virtual buffer position, including any adjacent space-negotiating adornments.
Public methodGetInsertionBufferPositionFromXCoordinateGets the buffer position used if new data were to be inserted at the given x-coordinate.
Public methodGetNormalizedTextBoundsGets a collection of TextBounds structures for the text that corresponds to the given span.
Public methodGetTextElementSpanGets the span whose text element index corresponds to the given buffer position.
Public methodGetVirtualBufferPositionFromXCoordinateGets the buffer position of the character whose character bounds contains the given x-coordinate.
Public methodIntersectsBufferSpanDetermines whether a bufferSpan intersects this text line.
Top

For information about formatting, see the "Formatted Text" section of Inside the Editor.

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.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft