Share via


Interfaccia CommandWindow

rappresenta commando finestra nell'ambiente.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Sintassi

'Dichiarazione
<GuidAttribute("509B9955-7303-48C9-90D4-E165B974E6BA")> _
Public Interface CommandWindow
[GuidAttribute("509B9955-7303-48C9-90D4-E165B974E6BA")]
public interface CommandWindow
[GuidAttribute(L"509B9955-7303-48C9-90D4-E165B974E6BA")]
public interface class CommandWindow
[<GuidAttribute("509B9955-7303-48C9-90D4-E165B974E6BA")>]
type CommandWindow =  interface end
public interface CommandWindow

Il tipo CommandWindow espone i seguenti membri.

Proprietà

  Nome Descrizione
Proprietà pubblica DTE Ottiene l'oggetto estensibilità di primo livello.
Proprietà pubblica Parent ottiene l'oggetto padre immediato di un oggetto specificato.
Proprietà pubblica TextDocument ottiene TextDocument per la finestra o nel riquadro.

In alto

Metodi

  Nome Descrizione
Metodo pubblico Clear Rimuovere tutto il testo dalla finestra.
Metodo pubblico OutputString Invia una stringa di testo a commando finestra.
Metodo pubblico SendInput Invia una riga di input a commando finestra che viene elaborata come se la digitare.

In alto

Note

Fare riferimento a questo oggetto tramite DTE.Windows.Item(vsWindowKindCommand).Object.

Esempi

Sub CommandWinExample(ByVal dte As DTE)
    ' Get a reference to the Command window.
    Dim win As Window = _
    DTE.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow)
    Dim CW As CommandWindow = win.Object

    ' Input a command into the Command window and execute it.
    CW.SendInput("nav https://www.microsoft.com", False)

    ' Insert some information text into the Command window.
    CW.OutputString("This URL takes you to the main Microsoft _
    website.")

    ' Clear the contents of the Command window.
    MsgBox("Clearing the Command window...")
    CW.Clear()
End Sub
void CommandWinExample(_DTE dte) 
{
    // Get a reference to the Command window.
    Window win =    
    dte.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow);
    CommandWindow CW = (CommandWindow)win.Object;

    // Input a command into the Command window and execute it.
    CW.SendInput("nav https://www.microsoft.com", false);

    // Insert some information text into the Command window.
    CW.OutputString("This URL takes you to the main Microsoft 
    website.");

    // Clear the contents of the Command window.
    MessageBox.Show("Clearing the Command window...");
    CW.Clear();
}

Vedere anche

Riferimenti

Spazio dei nomi EnvDTE