VirtualPoint Interface
Allows you to manipulate text beyond the right margin (left margin in bidirectional Windows) of the text document.
Namespace: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Syntax
'Declaration
<GuidAttribute("42320454-626C-4DD0-9ECB-357C4F1966D8")> _
Public Interface VirtualPoint _
Inherits TextPoint
[GuidAttribute("42320454-626C-4DD0-9ECB-357C4F1966D8")]
public interface VirtualPoint : TextPoint
[GuidAttribute(L"42320454-626C-4DD0-9ECB-357C4F1966D8")]
public interface class VirtualPoint : TextPoint
[<GuidAttribute("42320454-626C-4DD0-9ECB-357C4F1966D8")>]
type VirtualPoint =
interface
interface TextPoint
end
public interface VirtualPoint extends TextPoint
The VirtualPoint type exposes the following members.
Properties
Name | Description | |
---|---|---|
AbsoluteCharOffset | Gets the one-based character offset from the beginning of the document to the object. | |
AtEndOfDocument | Returns true if the object is at the end of the document. | |
AtEndOfLine | Returns true if the object is at the end of a line. | |
AtStartOfDocument | Returns true if the object is at the beginning of the document. | |
AtStartOfLine | Returns true if the object is at the beginning of a line. | |
CodeElement | Returns the code element at the VirtualPoint location. | |
DisplayColumn | Gets the number of the current displayed column containing the object. | |
DTE | Gets the top-level extensibility object. | |
Line | Gets the line number of the object. | |
LineCharOffset | Gets the character offset of the object. | |
LineLength | Gets the number of characters in a line containing the object, excluding the new line character. | |
Parent | Gets the immediate parent object of a VirtualPoint object. | |
VirtualCharOffset | Gets the column index of a virtual point in virtual space. | |
VirtualDisplayColumn | Gets the display column of the current position. |
Top
Methods
Name | Description | |
---|---|---|
CreateEditPoint | Creates and returns an EditPoint object at the location of the calling object. | |
EqualTo | Returns whether the value of the given TextPoint object's AbsoluteCharOffset property is equal to that of the calling VirtualPoint object. | |
GreaterThan | Returns whether the value of the calling object's AbsoluteCharOffset property is greater than that of the given point object. | |
LessThan | Returns whether the value of the called object's AbsoluteCharOffset property is less than that of the given object. | |
TryToShow | Attempts to display the text point's location. |
Top
Remarks
VirtualPoint objects are similar to the TextPoint object except that they can query virtual space in a document. VirtualPoint objects are returned by TextSelection.StartPoint and TextSelection.EndPoint.
Virtual space is the empty space to the right of existing lines of text, and virtual points exist in this area.
Examples
Sub VirtualPointExample()
' Before running this example, open a text document.
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
Dim objActive As VirtualPoint = objSel.ActivePoint
' Collapse the selection to the beginning of the line.
objSel.StartOfLine()
' objActive is "live", tied to the position of the actual selection,
' so it will reflect the new position.
Dim iCol As Long = objActive.DisplayColumn
' Move the selection to the end of the line.
objSel.EndOfLine()
MsgBox("The length of the insertion point line is " & (objActive.DisplayColumn - iCol) & " display characters.")
MsgBox("VirtualCharOffset value: " & objActive.VirtualCharOffset & vbCr & "VirtualDisplayColumn value: " & objActive.VirtualDisplayColumn)
End Sub