Search Results for

    Show / Hide Table of Contents

    Class DynamicObject

    Implementation of DynamicObject

    Inheritance
    System.Object
    DynamicObject
    DataContext
    ModelCollection<T>
    NamedDynamicObject
    DependencyEntityObject
    EntityObject
    LocalizedTextPropertyCollection
    LocalizedValueCollection
    RelationIdentifiers
    MemberAccessPermission
    MemberAccessPermissions
    Implements
    System.Dynamic.IDynamicMetaObjectProvider
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: TimeCockpit.Data
    Assembly: TimeCockpit.Data.dll
    Syntax
    public abstract class DynamicObject : IDynamicMetaObjectProvider
    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

    Declaration
    protected DynamicObject()

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

    Initializes a new instance of the DynamicObject class.

    Declaration
    protected DynamicObject(IEnumerable<KeyValuePair<object, object>> properties)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Object, System.Object>> properties

    Collection of properties.

    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.

    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)

    Methods

    GetMember(String)

    Gets the value of a CLR property.

    Declaration
    public virtual object GetMember(string name)
    Parameters
    Type Name Description
    System.String name

    Name of the member to get.

    Returns
    Type Description
    System.Object

    Reference to the dynamic member.

    GetMetaObject(Expression)

    Gets the meta object of the dynamic object.

    Declaration
    public virtual DynamicMetaObject GetMetaObject(Expression parameter)
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression parameter

    Provided by the DLR (Dynamic Language Runtime).

    Returns
    Type Description
    System.Dynamic.DynamicMetaObject

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

    SetMember(String, Object)

    Sets the value of a CLR property.

    Declaration
    public virtual void SetMember(string name, object value)
    Parameters
    Type Name Description
    System.String name

    Name of the member to set.

    System.Object value

    Value to set.

    In This Article
    Back to top Copyright © 2020 software architects gmbh