Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Ajusta la ubicación de la vista en el búfer de texto para que el intervalo de texto especificado se muestre en el panel de texto, si es posible.Se puede controlar en qué lugar del panel se muestra el texto.
Espacio de nombres: EnvDTE
Ensamblado: EnvDTE (en EnvDTE.dll)
Sintaxis
'Declaración
Function TryToShow ( _
Point As TextPoint, _
How As vsPaneShowHow, _
PointOrCount As Object _
) As Boolean
bool TryToShow(
TextPoint Point,
vsPaneShowHow How,
Object PointOrCount
)
bool TryToShow(
[InAttribute] TextPoint^ Point,
[InAttribute] vsPaneShowHow How,
[InAttribute] Object^ PointOrCount
)
abstract TryToShow :
Point:TextPoint *
How:vsPaneShowHow *
PointOrCount:Object -> bool
function TryToShow(
Point : TextPoint,
How : vsPaneShowHow,
PointOrCount : Object
) : boolean
Parámetros
- Point
Tipo: EnvDTE.TextPoint
Obligatorio.La ubicación de TextPoint que desea mostrar.
- How
Tipo: EnvDTE.vsPaneShowHow
Obligatorio.Constante vsPaneShowHow que indica cómo se debe mostrar el texto.
- PointOrCount
Tipo: System.Object
Opcional.Variante que representa el final del intervalo de texto que se va a mostrar.Si PointOrCount es un conjunto de caracteres, éstos se muestran a continuación del parámetro Point.Si PointOrCount es un punto delante de Point, estará en la parte superior del panel de texto si How se establece en vsPaneShowTop.
Si How se ha establecido en vsPaneShowCentered y el número de líneas del texto seleccionado supera el alto del panel, la línea superior del texto seleccionado se coloca en la parte superior del panel.
Valor devuelto
Tipo: System.Boolean
true si se puede mostrar el texto; en caso contrario, false.
Ejemplos
Sub TryToShowExample(ByVal dte As EnvDTE.DTE)
Dim objTW As TextWindow
Dim objPane As TextPane
Dim objStart As TextPoint
objTW = dte.ActiveWindow.Object
objPane = objTW.ActivePane
MsgBox("The active pane is " & Str(objPane.Height) & " lines high _
and " & Str(objPane.Width) & " columns wide.")
objStart = objPane.StartPoint
MsgBox("It begins at line " & Str(objStart.Line) & ", column " & _
Str(objStart.LineCharOffset) & ".")
objPane.TryToShow(objStart, vsPaneShowHow.vsPaneShowCentered)
End Sub
public void TryToShowExample(_DTE dte)
{
TextWindow tw;
TextPane tpn;
TextPoint tpt;
tw = (TextWindow)dte.ActiveWindow.Object;
tpn = tw.ActivePane;
MessageBox.Show ("The active pane is " + tpn.Height.ToString () + "
lines high and " + tpn.Width.ToString () + " columns wide.");
tpt = tpn.StartPoint;
MessageBox.Show ("It begins at line " + tpt.Line.ToString () + ",
column " + tpt.LineCharOffset.ToString () + ".");
tpn.TryToShow (tpt,vsPaneShowHow.vsPaneShowCentered,1);
}
Seguridad de .NET Framework
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.