ToolWindows.OutputWindow 属性

获取 OutputWindow 对象。

命名空间:  EnvDTE80
程序集:  EnvDTE80(在 EnvDTE80.dll 中)

语法

声明
ReadOnly Property OutputWindow As OutputWindow
OutputWindow OutputWindow { get; }
property OutputWindow^ OutputWindow {
    OutputWindow^ get ();
}
abstract OutputWindow : OutputWindow with get
function get OutputWindow () : OutputWindow

属性值

类型:OutputWindow
OutputWindow 对象。

示例

此示例添加一个标题为“My output”的**“输出窗口”**,激活它,向其中添加一些文本,然后清除它。 有关如何作为外接程序运行此示例的更多信息,请参见 如何:编译和运行自动化对象模型代码示例

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)
    OutputWindowManip(_applicationObject)
End Sub
Public Sub OutputWindowManip(ByVal dte As DTE2)
    Dim myOut As OutputWindow
    myOut = _applicationObject.ToolWindows.OutputWindow
    Dim myPane As OutputWindowPane
    MsgBox("Creating an output window.")
    myPane = myOut.OutputWindowPanes.Add("My output")
    myPane.Activate()
    MsgBox("Adding some text to the output window...")
    myPane.OutputString("Adding some text to the output window.")
    MsgBox("Clear the text")
    myPane.Clear()
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;
    OutputWindowManip(_applicationObject);
}
public void OutputWindowManip(DTE2 dte)
{
    OutputWindow myOut;
    myOut = _applicationObject.ToolWindows.OutputWindow;
    OutputWindowPane myPane;
    MessageBox.Show("Creating an output window...");
    myPane = myOut.OutputWindowPanes.Add("My output");
    myPane.Activate();
    MessageBox.Show("Adding some text to the output window...");
    myPane.OutputString("Adding some text to the output window.");
    MessageBox.Show("Clear the text");
    myPane.Clear();
}

.NET Framework 安全性

请参阅

参考

ToolWindows 接口

EnvDTE80 命名空间