Compartilhar via


Propriedade TextSelection.ActivePoint

Obtém o ponto de extremidade da seleção atual.

Namespace:  EnvDTE
Assembly:  EnvDTE (em EnvDTE.dll)

Sintaxe

'Declaração
ReadOnly Property ActivePoint As VirtualPoint
    Get
VirtualPoint ActivePoint { get; }
property VirtualPoint^ ActivePoint {
    VirtualPoint^ get ();
}
abstract ActivePoint : VirtualPoint
function get ActivePoint () : VirtualPoint

Valor de propriedade

Tipo: EnvDTE.VirtualPoint
A VirtualPoint objeto.

Comentários

Embora TextPoint objetos indicam o local do texto selecionado na Editor janela, eles não marcar a localização no buffer. Espaço virtual — a área além do fim da linha — também será rastreado apenas na Editor janela. Conseqüentemente, quando você usa um EditPoint o objeto no buffer de texto para modificar o texto, o que acontece com o texto selecionado não está definido. Por exemplo, um comando pode iniciar com o texto selecionado, receberá pontos de edição e altere o buffer. Para garantir que o texto selecionado estiver em um determinado local, você deve colocar explicitamente o texto selecionado no local no final do seu comando.

Exemplos

Sub ActivePointExample()
   ' 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.")
End Sub

Segurança do .NET Framework

Consulte também

Referência

TextSelection Interface

Namespace EnvDTE