Freigeben über


ToolWindows.CommandWindow-Eigenschaft

Ruft das CommandWindow-Objekt ab.

Namespace:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Syntax

'Declaration
ReadOnly Property CommandWindow As CommandWindow
CommandWindow CommandWindow { get; }
property CommandWindow^ CommandWindow {
    CommandWindow^ get ();
}
abstract CommandWindow : CommandWindow with get
function get CommandWindow () : CommandWindow

Eigenschaftswert

Typ: CommandWindow
Ein CommandWindow-Objekt.

Beispiele

In diesem Add-In-Beispiel wird das Befehlsfenster aktiviert, und anschließend wird diesem Fenster Text hinzugefügt. Weitere Informationen zum Ausführen der Automatisierungsbeispiele finden Sie unter Gewusst wie: Kompilieren und Ausführen der Codebeispiele für das Automatisierungsobjektmodell.

Imports EnvDTE
Imports EnvDTE80
Public Sub OnConnection(ByVal application As Object, _
 ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    _applicationObject = CType(application, DTE2)
    _addInInstance = CType(addInInst, AddIn)
    CommandWindowManip(_applicationObject)
End Sub
Public Sub CommandWindowManip(ByVal dte As DTE2)
    Dim myCmd As CommandWindow
    myCmd = _applicationObject.ToolWindows.CommandWindow
    MsgBox(myCmd.Parent.Caption & " is about to be activated.")
    myCmd.Parent.Activate()
    myCmd.OutputString("Test command window text.")
End Sub
using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public void OnConnection(object application,
 ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    CommandWindowManip(_applicationObject);
}
public void CommandWindowManip (DTE2 dte)
{
    CommandWindow myCmd;
    myCmd = _applicationObject.ToolWindows.CommandWindow;
    MessageBox.Show("The Command Window is about to be activated.");
    myCmd.Parent.Activate();
    myCmd.OutputString("Test command window text.");
}

.NET Framework-Sicherheit

Siehe auch

Referenz

ToolWindows Schnittstelle

EnvDTE80-Namespace