Partager via


OutputWindowPane.OutputString, méthode

Envoie une chaîne de texte vers la fenêtre OutputWindowPane.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

'Déclaration
Sub OutputString ( _
    Text As String _
)
void OutputString(
    string Text
)
void OutputString(
    [InAttribute] String^ Text
)
abstract OutputString : 
        Text:string -> unit 
function OutputString(
    Text : String
)

Paramètres

  • Text
    Type : System.String
    Obligatoire.Les caractères à envoyer à la fenêtre.

Notes

Cette méthode n'ajoute pas automatiquement des caractères de saut de ligne à la chaîne. Si vous souhaitez ces caractères, vous devez les ajouter à Text.

Exemples

Sub OutputStringExample(ByVal dte As DTE2)

    ' Find and show the "Test Pane" Output window pane.
    Dim outputWin As OutputWindow = dte.ToolWindows.OutputWindow
    Dim pane As OutputWindowPane
    Try
        pane = outputWin.OutputWindowPanes.Item("Test Pane")
    Catch
        pane = outputWin.OutputWindowPanes.Add("Test Pane")
    End Try
    outputWin.Parent.Activate()
    pane.Activate()

    ' Add a line of text to the new pane.
    pane.OutputString("Some text." & vbCrLf)

End Sub
public void OutputStringExample(DTE2 dte)
{
    // Find and show the "Test Pane" Output window pane.
    OutputWindow outputWin = dte.ToolWindows.OutputWindow;
    OutputWindowPane pane;

    try
    {
        pane = outputWin.OutputWindowPanes.Item("Test Pane");
    }
    catch (Exception)
    {
        pane = outputWin.OutputWindowPanes.Add("Test Pane");
    }

    outputWin.Parent.Activate();
    pane.Activate();

    // Add a line of text to the new pane.
    pane.OutputString("Some text." + "\r\n");
}

Sécurité .NET Framework

Voir aussi

Référence

OutputWindowPane Interface

EnvDTE, espace de noms

Autres ressources

Comment : compiler et exécuter les exemples de code du modèle objet Automation