ToolWindows.CommandWindow 属性
获取 CommandWindow 对象。
命名空间: EnvDTE80
程序集: EnvDTE80(在 EnvDTE80.dll 中)
语法
声明
ReadOnly Property CommandWindow As CommandWindow
CommandWindow CommandWindow { get; }
property CommandWindow^ CommandWindow {
CommandWindow^ get ();
}
abstract CommandWindow : CommandWindow
function get CommandWindow () : CommandWindow
属性值
类型:EnvDTE.CommandWindow
CommandWindow 对象。
示例
此外接程序示例激活“命令窗口”并向其中添加一些文本。有关如何运行自动化示例的更多信息,请参见 如何:编译和运行自动化对象模型代码示例。
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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。