Поделиться через


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
Public property AbsoluteCharOffset Gets the one-based character offset from the beginning of the document to the object.
Public property AtEndOfDocument Returns true if the object is at the end of the document.
Public property AtEndOfLine Returns true if the object is at the end of a line.
Public property AtStartOfDocument Returns true if the object is at the beginning of the document.
Public property AtStartOfLine Returns true if the object is at the beginning of a line.
Public property CodeElement Returns the code element at the VirtualPoint location.
Public property DisplayColumn Gets the number of the current displayed column containing the object.
Public property DTE Gets the top-level extensibility object.
Public property Line Gets the line number of the object.
Public property LineCharOffset Gets the character offset of the object.
Public property LineLength Gets the number of characters in a line containing the object, excluding the new line character.
Public property Parent Gets the immediate parent object of a VirtualPoint object.
Public property VirtualCharOffset Gets the column index of a virtual point in virtual space.
Public property VirtualDisplayColumn Gets the display column of the current position.

Top

Methods

  Name Description
Public method CreateEditPoint Creates and returns an EditPoint object at the location of the calling object.
Public method EqualTo Returns whether the value of the given TextPoint object's AbsoluteCharOffset property is equal to that of the calling VirtualPoint object.
Public method GreaterThan Returns whether the value of the calling object's AbsoluteCharOffset property is greater than that of the given point object.
Public method LessThan Returns whether the value of the called object's AbsoluteCharOffset property is less than that of the given object.
Public method 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

See Also

Reference

EnvDTE Namespace