Compartir a través de


Property.Object Property

Definition

Sets or gets the object supporting the Property object.

public:
 property System::Object ^ Object { System::Object ^ get(); void set(System::Object ^ value); };
public:
 property Platform::Object ^ Object { Platform::Object ^ get(); void set(Platform::Object ^ value); };
[System.Runtime.InteropServices.DispId(45)]
public object Object { [System.Runtime.InteropServices.DispId(45)] get; [System.Runtime.InteropServices.DispId(45)] set; }
[<System.Runtime.InteropServices.DispId(45)>]
[<get: System.Runtime.InteropServices.DispId(45)>]
[<set: System.Runtime.InteropServices.DispId(45)>]
member this.Object : obj with get, set
Public Property Object As Object

Property Value

An object representing the value of the Property object.

Attributes

Examples

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

Remarks

If you use Property.Value instead of Property.Object, then the Property object returns a Properties collection instead of an Object value. That is, the IDispatch that would be returned via Property.Object is wrapped so that Property.Value returns a nested Properties collection.

Applies to