Class Expando

Class that provides extensible properties and methods to an existing object when cast to dynamic. This dynamic object stores 'extra' properties in a dictionary or checks the actual properties of the instance passed via constructor.

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

System.Object
  System.Dynamic.DynamicObject
    Westwind.Utilities.Expando
public class Expando : DynamicObject

Class Members

MemberDescription

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

Checks whether a property exists in the Property collection or as a property on the instance

public bool Contains(KeyValuePair<String,Object> item,     bool includeInstanceProperties)

GetDynamicMemberNames

Return both instance and dynamic names.

public virtual IEnumerable 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

Requirements

Namespace: Westwind.Utilities
Assembly: westwind.utilities.dll

© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic