Search Results for

    Show / Hide Table of Contents

    Class DependencyEntityObject

    A wrapper for entity objects, that implements IDataErrorInfo and throws notifications.

    Inheritance
    System.Object
    DynamicObject
    DependencyEntityObject
    Implements
    System.Dynamic.IDynamicMetaObjectProvider
    System.ComponentModel.INotifyPropertyChanged
    IEntityObject
    System.ComponentModel.IDataErrorInfo
    TimeCockpit.Common.IWeakEventListener
    Inherited Members
    DynamicObject.GetMetaObject(Expression)
    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 class DependencyEntityObject : DynamicObject, IDynamicMetaObjectProvider, INotifyPropertyChanged, IEntityObject, IDataErrorInfo, IWeakEventListener

    Constructors

    DependencyEntityObject()

    Initializes a new instance of the DependencyEntityObject class.

    Declaration
    public DependencyEntityObject()

    Properties

    DataContext

    Gets or sets the data context to evaluate permissions

    Declaration
    public IDataContext DataContext { get; set; }
    Property Value
    Type Description
    IDataContext

    EntityObject

    Gets or sets the underlying EntityObject.

    Declaration
    public EntityObject EntityObject { get; set; }
    Property Value
    Type Description
    EntityObject

    Error

    Gets an error message indicating why validation fails for this object. This property calls all the ValidationRules of an EntityObject and aggregates their messages if they fail. That is, if an EntityObject validates o.k. the property returns null. Else, it returns the first entry of the list of strings representing the error messages defined in the ValidationRules.

    Declaration
    public string Error { get; }
    Property Value
    Type Description
    System.String

    IsValid

    Gets a value indicating whether the EntityObject is valid or not.

    Declaration
    public bool IsValid { get; }
    Property Value
    Type Description
    System.Boolean

    Me

    Gets the it self

    Declaration
    public EntityObject Me { get; }
    Property Value
    Type Description
    EntityObject
    Remarks

    This property is needed for DataBinding reasons. Whenever a property of an EntityObject is changed (e.g. via z.SetMember("X", "Y")), the OnPropertyChanged(String) event of that property + the OnPropertyChanged(String) event of the Me property is fired.

    MemberAccessPermissions

    Gets the member permission information.

    Declaration
    public virtual MemberAccessPermissions MemberAccessPermissions { get; }
    Property Value
    Type Description
    MemberAccessPermissions

    MemberAccessPermissionsInternal

    Gets or sets the member access permissions.

    Declaration
    protected MemberAccessPermissions MemberAccessPermissionsInternal { get; set; }
    Property Value
    Type Description
    MemberAccessPermissions

    MemberAccessPermissionsLock

    Gets the member access permissions lock.

    Declaration
    protected object MemberAccessPermissionsLock { get; }
    Property Value
    Type Description
    System.Object

    ModelEntityName

    Gets the name of the current instance of EntityObject

    Declaration
    public string ModelEntityName { get; }
    Property Value
    Type Description
    System.String
    Implements
    IEntityObject.ModelEntityName

    ObjectUuid

    Gets the unique id of the object.

    Declaration
    public Guid ObjectUuid { get; }
    Property Value
    Type Description
    System.Guid
    Implements
    IEntityObject.ObjectUuid

    Methods

    Create(EntityObject, IDataContext)

    Returns a new instance for EntityObjects that provides functionality specific to the user interface

    Declaration
    public static DependencyEntityObject Create(EntityObject entityObject, IDataContext context)
    Parameters
    Type Name Description
    EntityObject entityObject

    The EntityObject to wrap.

    IDataContext context

    An instance of DataContext to work on.

    Returns
    Type Description
    DependencyEntityObject

    An instance of DependencyEntityObject wrapping an instance of EntityObject.

    GetMember(String)

    Gets the value of the specified member.

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

    Name of the member.

    Returns
    Type Description
    System.Object

    Returns the value of the specified member.

    Overrides
    DynamicObject.GetMember(String)
    Remarks

    This method also returns the clr properties '{ModelEntityName}Uuid' and 'IsReadOnly' of an EntityObject.

    GetMemberAccessPermissions<T>()

    Gets the member access permissions.

    Declaration
    public MemberAccessPermissions GetMemberAccessPermissions<T>()
        where T : MemberAccessPermissions
    Returns
    Type Description
    MemberAccessPermissions

    An instance of MemberAccessPermissions or an inherited class.

    Type Parameters
    Name Description
    T

    Either MemberAccessPermissions or a derived type.

    MergeFrom(EntityObject)

    Merges the specified entity object into the current instance of DependencyEntityObject.

    Declaration
    public void MergeFrom(EntityObject entityObject)
    Parameters
    Type Name Description
    EntityObject entityObject

    The entity object.

    OnPropertyChanged(String)

    Invoked whenever the value of any property on this object has been updated. The specific property that changed is reported in the event data.

    Declaration
    protected virtual void OnPropertyChanged(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName

    Name of the property that has been updated.

    Remarks

    This method sets a property in the values collection of an EntityObject to MemberStatus.Changed. Each call of the method calls OnPropertyChanged(String) for the clr properties 'IsChanged', 'Me', 'IsReadonly'.

    ReceiveWeakEvent(Type, Object, EventArgs)

    Receives events from the centralized event manager.

    Declaration
    public bool ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Type managerType

    The type of the WeakEventManager calling this method.

    System.Object sender

    Object that originated the event.

    System.EventArgs e

    Event data.

    Returns
    Type Description
    System.Boolean

    true if the listener handled the event. It is considered an error by the WeakEventManager handling in WPF to register a listener for an event that the listener does not handle. Regardless, the method should return false if it receives an event that it does not recognize or handle.

    SetMember(String, Object)

    Sets a dynamic member.

    Declaration
    public override 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.

    Overrides
    DynamicObject.SetMember(String, Object)

    Events

    PropertyChanged

    Occurs when a property value changes.

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type Description
    System.ComponentModel.PropertyChangedEventHandler
    In This Article
    Back to top Copyright © 2020 software architects gmbh