Sdílet prostřednictvím


Property.Object – vlastnost

Nastaví nebo získává podporu objektu Property objektu.

Obor názvů:  EnvDTE
Sestavení:  EnvDTE (v EnvDTE.dll)

Syntaxe

'Deklarace
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)

Hodnota vlastnosti

Typ: Object
Objekt reprezentující hodnotu Property objektu.

Poznámky

Pokud doplněk používá Property.Value namísto Property.Object, pak bude Property vrátí objekt Properties kolekce namísto Object hodnotu.Je IDispatch bude vrácen prostřednictvím Property.Object zabalen tak, aby Property.Value vrátí vnořené Properties kolekce.

Příklady

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

Zabezpečení rozhraní .NET Framework

Viz také

Referenční dokumentace

Property Rozhraní

EnvDTE – obor názvů

Další zdroje

Postupy: Kompilace a spuštění příkladů kódu objektu automatizace