Freigeben über


Property.Object-Eigenschaft

Legt das Objekt fest, das das Property-Objekt unterstützt, oder ruft es ab.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
Property Object As Object
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)

Eigenschaftswert

Typ: Object
Ein Objekt, das den Wert des Property-Objekts darstellt.

Hinweise

Wenn ein Add-In Property.Value anstelle von Property.Object verwendet, gibt das Property-Objekt eine Properties-Auflistung und keinen Object-Wert zurück. Die über Property.Object zurückgegebene IDispatch wird umschlossen, damit Property.Value eine geschachtelte Properties-Auflistung zurückgibt.

Beispiele

' 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");
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Property Schnittstelle

EnvDTE-Namespace

Weitere Ressourcen

Gewusst wie: Kompilieren und Ausführen der Codebeispiele für das Automatisierungsobjektmodell