This class can be subclassed to extend an existing type or you can pass in an instance to extend. Properties (both dynamic and strongly typed) can be accessed through an indexer.
This type allows you three ways to access its properties:
Directly: any explicitly declared properties are accessible Dynamic: dynamic cast allows access to dictionary and native properties/methods Dictionary: Any of the extended properties are accessible via IDictionary interface
public class Expando : DynamicObject
Member | Description | |
---|---|---|
Constructor | This constructor just works off the internal dictionary and any public properties of this object. | |
Properties | String Dictionary that contains the extra dynamic values stored on this object/instance | |
Contains | public bool Contains(KeyValuePair<String,Object> item,
bool includeInstanceProperties); |
|
GetDynamicMemberNames | public virtual IEnumerable<String> GetDynamicMemberNames();
|
|
GetProperties | Returns and the properties of public IEnumerable<KeyValuePair`2> GetProperties(bool includeInstanceProperties);
|
|
TryGetMember | Try to retrieve a member by name first from instance properties followed by the collection entries. public virtual bool TryGetMember(GetMemberBinder binder,
ref object result); |
|
TryInvokeMember | Dynamic invocation method. Currently allows only for Reflection based operation (no ability to add methods dynamically). public virtual bool TryInvokeMember(InvokeMemberBinder binder,
Object[] args, ref object result); |
|
TrySetMember | Property setter implementation tries to retrieve value from instance first then into this object public virtual bool TrySetMember(SetMemberBinder binder,
object value); |
|
Item |