ITextView ITextView ITextView ITextView ITextView ITextView Interface

Definition

Represents a view of text in an ITextBuffer. It is the base class for a platform-specific interface that has methods to allow the formatted text to be rendered.

public interface class ITextView : Microsoft::VisualStudio::Utilities::IPropertyOwner
public interface class ITextView : Microsoft::VisualStudio::Utilities::IPropertyOwner
__interface ITextView : Microsoft::VisualStudio::Utilities::IPropertyOwner
public interface ITextView : Microsoft.VisualStudio.Utilities.IPropertyOwner
type ITextView = interface
    interface IPropertyOwner
Public Interface ITextView
Implements IPropertyOwner
Derived
Implements

Remarks

A text view is a platform-independent representation of a contiguous block of formatted and adorned text. The text can be accessed through the TextViewLines property.

For more information about text views, see the section "The Text View" in Inside the Editor.

The text view also instantiates an instance of an IEditorOperations component part so that it can execute various commands.

The text is formatted based on the classifiers that are attached to the underlying ITextBuffer.

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 ViewportTop property, which causes 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 one unit in the text rendering coordinate system corresponds to one pixel in the display.

Properties

BufferGraph BufferGraph BufferGraph BufferGraph BufferGraph BufferGraph

Gets the IBufferGraph that contains the set of source buffers that contribute to this view.

Caret Caret Caret Caret Caret Caret

Gets the caret element.

HasAggregateFocus HasAggregateFocus HasAggregateFocus HasAggregateFocus HasAggregateFocus HasAggregateFocus

Determines whether the view or any of its adornments has focus.

InLayout InLayout InLayout InLayout InLayout InLayout

Determines whether the view is in the process of being laid out.

IsClosed IsClosed IsClosed IsClosed IsClosed IsClosed

Determines whether this text view has been closed.

IsMouseOverViewOrAdornments IsMouseOverViewOrAdornments IsMouseOverViewOrAdornments IsMouseOverViewOrAdornments IsMouseOverViewOrAdornments IsMouseOverViewOrAdornments

Determines whether the mouse is over the view or any of its adornments.

LineHeight LineHeight LineHeight LineHeight LineHeight LineHeight

Gets the nominal height of a line of text in the view.

MaxTextRightCoordinate MaxTextRightCoordinate MaxTextRightCoordinate MaxTextRightCoordinate MaxTextRightCoordinate MaxTextRightCoordinate

Gets the right coordinate of the longest line, whether or not that line is currently visible, in logical pixels.

Options Options Options Options Options Options

Gets the options for this text view.

ProvisionalTextHighlight ProvisionalTextHighlight ProvisionalTextHighlight ProvisionalTextHighlight ProvisionalTextHighlight ProvisionalTextHighlight

Gets the span of text covered by the provisional text highlight.

Roles Roles Roles Roles Roles Roles

The roles which this view plays. Roles partially determine the extensions that are instantiated for the view.

Selection Selection Selection Selection Selection Selection

Gets the selection element.

TextBuffer TextBuffer TextBuffer TextBuffer TextBuffer TextBuffer

Gets the ITextBuffer whose text is rendered in this view.

TextDataModel TextDataModel TextDataModel TextDataModel TextDataModel TextDataModel

Gets the ITextDataModel of this text view.

TextSnapshot TextSnapshot TextSnapshot TextSnapshot TextSnapshot TextSnapshot

Gets the ITextSnapshot of the text that is currently rendered in the view.

TextViewLines TextViewLines TextViewLines TextViewLines TextViewLines TextViewLines

Gets a read-only list of the ITextViewLine objects rendered in this view.

TextViewModel TextViewModel TextViewModel TextViewModel TextViewModel TextViewModel

Gets the ITextViewModel of this text view.

ViewportBottom ViewportBottom ViewportBottom ViewportBottom ViewportBottom ViewportBottom

Gets the position of the bottom edge of the viewpoint in the text rendering coordinate system.

ViewportHeight ViewportHeight ViewportHeight ViewportHeight ViewportHeight ViewportHeight

Gets the height of the visible content window (including the margin) in logical pixels.

ViewportLeft ViewportLeft ViewportLeft ViewportLeft ViewportLeft ViewportLeft

Gets or sets the position of the left edge of the viewpoint in the text rendering coordinate system.

ViewportRight ViewportRight ViewportRight ViewportRight ViewportRight ViewportRight

Gets the position of the right edge of the viewpoint in the text rendering coordinate system.

ViewportTop ViewportTop ViewportTop ViewportTop ViewportTop ViewportTop

Gets the position of the top edge of the viewpoint in the text rendering coordinate system.

ViewportWidth ViewportWidth ViewportWidth ViewportWidth ViewportWidth ViewportWidth

Gets the width of the visible content window (including the margin) in logical pixels.

ViewScroller ViewScroller ViewScroller ViewScroller ViewScroller ViewScroller

Gets a helper that provides various methods to scroll or manipulate the view.

VisualSnapshot VisualSnapshot VisualSnapshot VisualSnapshot VisualSnapshot VisualSnapshot

Gets the ITextSnapshot of the visual buffer that is being rendered.

Methods

Close() Close() Close() Close() Close() Close()

Closes the text view host and its view.

DisplayTextLineContainingBufferPosition(SnapshotPoint, Double, ViewRelativePosition) DisplayTextLineContainingBufferPosition(SnapshotPoint, Double, ViewRelativePosition) DisplayTextLineContainingBufferPosition(SnapshotPoint, Double, ViewRelativePosition) DisplayTextLineContainingBufferPosition(SnapshotPoint, Double, ViewRelativePosition) DisplayTextLineContainingBufferPosition(SnapshotPoint, Double, ViewRelativePosition) DisplayTextLineContainingBufferPosition(SnapshotPoint, Double, ViewRelativePosition)

Formats and displays the contents of the text buffer so that the ITextViewLine containing the buffer position is displayed at the desired position.

DisplayTextLineContainingBufferPosition(SnapshotPoint, Double, ViewRelativePosition, Nullable<Double>, Nullable<Double>) DisplayTextLineContainingBufferPosition(SnapshotPoint, Double, ViewRelativePosition, Nullable<Double>, Nullable<Double>) DisplayTextLineContainingBufferPosition(SnapshotPoint, Double, ViewRelativePosition, Nullable<Double>, Nullable<Double>) DisplayTextLineContainingBufferPosition(SnapshotPoint, Double, ViewRelativePosition, Nullable<Double>, Nullable<Double>) DisplayTextLineContainingBufferPosition(SnapshotPoint, Double, ViewRelativePosition, Nullable<Double>, Nullable<Double>) DisplayTextLineContainingBufferPosition(SnapshotPoint, Double, ViewRelativePosition, Nullable<Double>, Nullable<Double>)

Formats and displays the contents of the text buffer so that the ITextViewLine containing the specified buffer position is displayed at the desired position.

GetTextElementSpan(SnapshotPoint) GetTextElementSpan(SnapshotPoint) GetTextElementSpan(SnapshotPoint) GetTextElementSpan(SnapshotPoint) GetTextElementSpan(SnapshotPoint) GetTextElementSpan(SnapshotPoint)

Gets the SnapshotSpan of text that constitutes a text element (a single visual representation) at the given SnapshotPoint.

GetTextViewLineContainingBufferPosition(SnapshotPoint) GetTextViewLineContainingBufferPosition(SnapshotPoint) GetTextViewLineContainingBufferPosition(SnapshotPoint) GetTextViewLineContainingBufferPosition(SnapshotPoint) GetTextViewLineContainingBufferPosition(SnapshotPoint) GetTextViewLineContainingBufferPosition(SnapshotPoint)

Gets the ITextViewLine that contains the specified text buffer position.

QueueSpaceReservationStackRefresh() QueueSpaceReservationStackRefresh() QueueSpaceReservationStackRefresh() QueueSpaceReservationStackRefresh() QueueSpaceReservationStackRefresh() QueueSpaceReservationStackRefresh()

Requests a refresh of the space reservation stack.

Events

Closed Closed Closed Closed Closed Closed

Occurs immediately after the text view is closed.

GotAggregateFocus GotAggregateFocus GotAggregateFocus GotAggregateFocus GotAggregateFocus GotAggregateFocus

Occurs when the keyboard focus switches to the view or one of its adornments.

LayoutChanged LayoutChanged LayoutChanged LayoutChanged LayoutChanged LayoutChanged

Occurs when the text editor performs a text line layout.

LostAggregateFocus LostAggregateFocus LostAggregateFocus LostAggregateFocus LostAggregateFocus LostAggregateFocus

Occurs when the keyboard focus switches away from the view and any of its adornments.

MouseHover MouseHover MouseHover MouseHover MouseHover MouseHover

Occurs when the mouse has hovered over a character.

ViewportHeightChanged ViewportHeightChanged ViewportHeightChanged ViewportHeightChanged ViewportHeightChanged ViewportHeightChanged

Occurs when the viewport height is changed. Deprecated.

ViewportLeftChanged ViewportLeftChanged ViewportLeftChanged ViewportLeftChanged ViewportLeftChanged ViewportLeftChanged

Occurs when the position of the viewport left edge is changed. Deprecated

ViewportWidthChanged ViewportWidthChanged ViewportWidthChanged ViewportWidthChanged ViewportWidthChanged ViewportWidthChanged

Occurs when the viewport width is changed. Deprecated.

Applies to