EditPoint2.TryToShow(vsPaneShowHow, Object) Método

Definição

Tenta exibir o local do ponto de texto.

bool TryToShow(EnvDTE::vsPaneShowHow How = EnvDTE.vsPaneShowHow.vsPaneShowCentered, winrt::Windows::Foundation::IInspectable const & PointOrCount);
[System.Runtime.InteropServices.DispId(50)]
public bool TryToShow (EnvDTE.vsPaneShowHow How = EnvDTE.vsPaneShowHow.vsPaneShowCentered, object PointOrCount);
[<System.Runtime.InteropServices.DispId(50)>]
abstract member TryToShow : EnvDTE.vsPaneShowHow * obj -> bool
Public Function TryToShow (Optional How As vsPaneShowHow = EnvDTE.vsPaneShowHow.vsPaneShowCentered, Optional PointOrCount As Object) As Boolean

Parâmetros

How
vsPaneShowHow

Opcional. Uma vsPaneShowHow constante que determina como o código é exibido.

PointOrCount
Object

Opcional. O ponto de extremidade do intervalo de texto selecionado a ser exibido. Pode ser um TextPoint ou um inteiro.

Retornos

Boolean

true Se o intervalo de texto couber no editor de códigos atual; caso contrário, false .

Implementações

Atributos

Exemplos

Sub TryToShowExample(ByVal dte As DTE2)  

    ' Before running this example, open a text document.  
    Dim win As Window = dte.ActiveWindow  
    Dim textWin As TextWindow = CType(win.Object, TextWindow)  

    ' Split the text document window.  
    Dim cmd As Command = dte.Commands.Item("Window.Split")  
    dte.Commands.Raise(cmd.Guid, cmd.ID, Nothing, Nothing)  

    ' Display the beginning of the document in the top pane and the   
    ' end of the document in the bottom pane.  
    Dim sel As TextSelection = textWin.Panes.Item(2).Selection  
    sel.StartOfDocument()  
    sel.ActivePoint.TryToShow()  
    sel = textWin.Panes.Item(1).Selection  
    sel.EndOfDocument()  
    sel.ActivePoint.TryToShow()  

End Sub  
public void TryToShowExample(DTE2 dte)  
{  
    // Before running this example, open a text document.  
    Window win = dte.ActiveWindow;  
    TextWindow textWin = (TextWindow)win.Object;  

    // Split the text document window.  
    Command cmd = dte.Commands.Item("Window.Split", -1);  
    object dummy = null;  
    dte.Commands.Raise(cmd.Guid, cmd.ID, ref dummy, ref dummy);  

    // Display the beginning of the document in the top pane and the   
    // end of the document in the bottom pane.  
    TextSelection sel = textWin.Panes.Item(2).Selection;  
    sel.StartOfDocument(false);  
    sel.ActivePoint.TryToShow(vsPaneShowHow.vsPaneShowCentered, null);  
    sel = textWin.Panes.Item(1).Selection;  
    sel.EndOfDocument(false);  
    sel.ActivePoint.TryToShow(vsPaneShowHow.vsPaneShowCentered, null);  
}  

Comentários

TryToShow ajusta o local do buffer na exibição de código para que o intervalo indicado de texto seja exibido no editor de códigos, se possível. TryToShow é semelhante ao TextPane método do objeto Activate , exceto pelo fato de que ele tenta exibir a janela e o intervalo de texto especificado.

Aplica-se a