Share via


TextSelection.TextRanges (Propiedad)

Obtiene una colección TextRanges con un objeto TextRange para cada línea (entera o parcial) de la selección.

Espacio de nombres:  EnvDTE
Ensamblado:  EnvDTE (en EnvDTE.dll)

Sintaxis

'Declaración
ReadOnly Property TextRanges As TextRanges
TextRanges TextRanges { get; }
property TextRanges^ TextRanges {
    TextRanges^ get ();
}
abstract TextRanges : TextRanges with get
function get TextRanges () : TextRanges

Valor de propiedad

Tipo: EnvDTE.TextRanges
Colección de TextRanges.

Comentarios

Para cada línea de la selección de texto, sin tener en cuenta el modo actual, un objeto de TextRange representa la parte virtual de la línea de la selección. Cuando el modo de selección es Stream, los objetos TextRange sólo representan el texto que está en la selección. Si algunas líneas son más largas que otras, sólo obtiene los intervalos para las líneas que realmente contienen texto.

Cada vez que la colección de TextRanges se recupera de la selección de texto, se pierden el contenido anteriores.

Ejemplos

Sub TextRangesExample()
   ' Before running this example, open a code document.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   MsgBox("Startpoint line: " & (objSel.TextRanges.Item(1).StartPoint.Line) & vbCr & "Endpoint line: " & (objSel.TextRanges.Item(1).EndPoint.Line))
End Sub

Seguridad de .NET Framework

Vea también

Referencia

TextSelection Interfaz

EnvDTE (Espacio de nombres)