Table of Contents

Class DynamicObject

Namespace
TimeCockpit.Data
Assembly
TimeCockpit.Data.dll

Implementation of DynamicObject

public abstract class DynamicObject : IDynamicMetaObjectProvider
Inheritance
Object
DynamicObject
Implements
IDynamicMetaObjectProvider
Derived
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()

Remarks

Supports the library for integrating with the Dynamic Language Runtime. This class must not be used outside of this library!

Caution! Will be replaced as soon as implementation of C# 4.0 becomes available.

Constructors

DynamicObject()

Initializes a new instance of the DynamicObject class

protected DynamicObject()

DynamicObject(IEnumerable<KeyValuePair<Object, Object>>)

Initializes a new instance of the DynamicObject class.

protected DynamicObject(IEnumerable<KeyValuePair<object, object>> properties)

Parameters

properties IEnumerable<KeyValuePair<Object, Object>>

Collection of properties.

Examples

flatDim = ModelEntity({ "Name": "Project" })
flatDim.Properties.Add(TextProperty({ "Name": "ProjectName", "MaxStorageSize": 50 }))
flatDim.Properties.Add(DateTimeProperty({ "Name": "BeginTime", "FractionalSecondsPrecision": 2 }))
Context.Model.Entities.Add(flatDim)

Remarks

You can use this constructor to initialize a new instance of the DynamicObject class by specifying its properties in a list of key/value pairs. This is especially useful for dynamic languages like python.

Methods

GetMember(String)

Gets the value of a CLR property.

public virtual object GetMember(string name)

Parameters

name String

Name of the member to get.

Returns

Object

Reference to the dynamic member.

GetMetaObject(Expression)

Gets the meta object of the dynamic object.

public virtual DynamicMetaObject GetMetaObject(Expression parameter)

Parameters

parameter Expression

Provided by the DLR (Dynamic Language Runtime).

Returns

DynamicMetaObject

DynamicObject.DynamicMetaObject that represents this specific object’s binding logic.

SetMember(String, Object)

Sets the value of a CLR property.

public virtual void SetMember(string name, object value)

Parameters

name String

Name of the member to set.

value Object

Value to set.