共用方式為


Window2.Object 屬性

取得物件,此物件可在執行階段中以名稱存取。

命名空間:  EnvDTE80
組件:  EnvDTE80 (在 EnvDTE80.dll 中)

語法

'宣告
ReadOnly Property Object As Object
Object Object { get; }
property Object^ Object {
    Object^ get ();
}
abstract Object : Object
function get Object () : Object

屬性值

型別:System.Object
物件。

備註

傳回以視窗所表示之工具的擴充性物件。

範例

這個範例會建立 OutputWindow 物件,然後使用這個物件將文字寫入至 OutputWindowPane 物件。

如需如何像執行增益集一般,執行這個範例的詳細資訊,請參閱 HOW TO:編譯和執行 Automation 物件模型程式碼範例

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)
    ObjectExample(_applicationObject)
End Sub
Sub ObjectExample(ByVal dte As DTE2)
    Dim win As Window2
    win = _
CType(_applicationObject.Windows.Item _
(Constants.vsWindowKindOutput), Window2)
    Dim output As OutputWindow
    Dim outpane As OutputWindowPane
    output = CType(win.Object(), OutputWindow)
    outpane = output.OutputWindowPanes.Add("my output")
    outpane.OutputString("Add test text to an Ouput  _
    pane obtained from the Window2.Object.")
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;
    ObjectExample(_applicationObject);
}
public void ObjectExample (DTE2 dte)
{
    Window2 win;
    win = 
(Window2)_applicationObject.Windows.Item
(Constants.vsWindowKindOutput);
    OutputWindow output;
    OutputWindowPane outpane;
    output = (OutputWindow)win.Object;
    outpane = output.OutputWindowPanes.Add("My Output");
    outpane.OutputString("Add test text to an Ouput pane 
obtained from the Window2.Object.");
}

.NET Framework 安全性

請參閱

參考

Window2 介面

Object 多載

EnvDTE80 命名空間