Partager via


Window2.Object, propriété

Obtient un objet accessible par nom au moment de l'exécution.

Espace de noms :  EnvDTE80
Assembly :  EnvDTE80 (dans EnvDTE80.dll)

Syntaxe

'Déclaration
ReadOnly Property Object As Object
Object Object { get; }
property Object^ Object {
    Object^ get ();
}
abstract Object : Object
function get Object () : Object

Valeur de propriété

Type : System.Object
Objet.

Notes

Retourne l'objet d'extensibilité pour l'outil représenté par la fenêtre.

Exemples

Cet exemple crée un objet OutputWindow, puis l'utilise pour écrire du texte dans un objet OutputWindowPane.

Pour plus d'informations sur l'exécution de cet exemple comme complément, consultez Comment : compiler et exécuter les exemples de code du modèle objet 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.");
}

Sécurité .NET Framework

Voir aussi

Référence

Window2 Interface

Object, surcharge

EnvDTE80, espace de noms