Partager via


Property.Object, propriété

Définit ou obtient l'objet prenant en charge l'objet Property.

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

Syntaxe

'Déclaration
Property Object As Object
    Get
    Set
Object Object { get; set; }
property Object^ Object {
    Object^ get ();
    void set (Object^ value);
}
abstract Object : Object with get, set
function get Object () : Object
function set Object (value : Object)

Valeur de propriété

Type : System.Object
Objet représentant la valeur de l'objet Property.

Notes

Si un complément utilise Property.Value au lieu de Property.Object, l'objet Property retourne une collection Properties, et non une valeur Object. Autrement dit, la valeur IDispatch devant être retournée via Property.Object est mise en boucle pour que Property.Value retourne une collection Properties imbriquée.

Exemples

' Visual Studio macro.
Sub ObjectExample3(ByVal dte As DTE2)

    ' Retrieve and display the text editor color setting for 
    ' code comments.
    Dim props As Properties = _
        dte.Properties("FontsAndColors", "TextEditor")
    Dim prop As [Property] = props.Item("FontsAndColorsItems")
    Dim items As FontsAndColorsItems = _
        CType(prop.Object, FontsAndColorsItems)
    Dim item As ColorableItems = items.Item("Comment")

    MsgBox(item.Name & " items have an OLE_COLOR value of " & _
        item.Foreground.ToString() & vbCrLf)

End Sub
public void ObjectExample(DTE2 dte)
{
    // Retrieve and display the text editor color setting for 
    // code comments.
    Properties props = 
        dte.get_Properties("FontsAndColors", "TextEditor");
    Property prop = props.Item("FontsAndColorsItems");
    FontsAndColorsItems items = (FontsAndColorsItems)prop.Object;
    ColorableItems item = items.Item("Comment");

    MessageBox.Show(item.Name + " items have an OLE_COLOR value of " + 
        item.Foreground.ToString() + "\n");
}

Sécurité .NET Framework

Voir aussi

Référence

Property Interface

EnvDTE, espace de noms

Autres ressources

Comment : compiler et exécuter les exemples de code du modèle objet Automation