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)

[GuidAttribute("42320454-626C-4DD0-9ECB-357C4F1966D8")]
public interface VirtualPoint : TextPoint

NameDescription
System_CAPS_pubpropertyAbsoluteCharOffset

Gets the one-based character offset from the beginning of the document to the object.

System_CAPS_pubpropertyAtEndOfDocument

Returns true if the object is at the end of the document.

System_CAPS_pubpropertyAtEndOfLine

Returns true if the object is at the end of a line.

System_CAPS_pubpropertyAtStartOfDocument

Returns true if the object is at the beginning of the document.

System_CAPS_pubpropertyAtStartOfLine

Returns true if the object is at the beginning of a line.

System_CAPS_pubpropertyCodeElement[vsCMElement]

Returns the code element at the VirtualPoint location.

System_CAPS_pubpropertyDisplayColumn

Gets the number of the current displayed column containing the object.

System_CAPS_pubpropertyDTE

Gets the top-level extensibility object.

System_CAPS_pubpropertyLine

Gets the line number of the object.

System_CAPS_pubpropertyLineCharOffset

Gets the character offset of the object.

System_CAPS_pubpropertyLineLength

Gets the number of characters in a line containing the object, excluding the new line character.

System_CAPS_pubpropertyParent

Gets the immediate parent object of a VirtualPoint object.

System_CAPS_pubpropertyVirtualCharOffset

Gets the column index of a virtual point in virtual space.

System_CAPS_pubpropertyVirtualDisplayColumn

Gets the display column of the current position.

NameDescription
System_CAPS_pubmethodCreateEditPoint()

Creates and returns an EditPoint object at the location of the calling object.

System_CAPS_pubmethodEqualTo(TextPoint)

Returns whether the value of the given TextPoint object's AbsoluteCharOffset property is equal to that of the calling VirtualPoint object.

System_CAPS_pubmethodGreaterThan(TextPoint)

Returns whether the value of the calling object's AbsoluteCharOffset property is greater than that of the given point object.

System_CAPS_pubmethodLessThan(TextPoint)

Returns whether the value of the called object's AbsoluteCharOffset property is less than that of the given object.

System_CAPS_pubmethodTryToShow(vsPaneShowHow, Object)

Attempts to display the text point's location.

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.

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
Return to top
Show: