Table of Contents

Class RelationBase

Namespace
TimeCockpit.Data.DataModel
Assembly
TimeCockpit.Data.dll

Base class for relations (with storage) and virtual relations (with conditions).

public abstract class RelationBase : ModelElement, IDynamicMetaObjectProvider, INotifyPropertyChanged, IDataErrorInfo, INullable
Inheritance
System.Object
RelationBase
Implements
System.Dynamic.IDynamicMetaObjectProvider
System.ComponentModel.INotifyPropertyChanged
System.ComponentModel.IDataErrorInfo
Derived
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()

Constructors

RelationBase()

Initializes a new instance of the RelationBase class.

public RelationBase()

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

Initializes a new instance of the RelationBase class.

public RelationBase(IEnumerable<KeyValuePair<object, object>> properties)

Parameters

properties System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Object, System.Object>>

Collection of properties.

Remarks

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

RelationBase(RelationBase)

Initializes a new instance of the RelationBase class.

public RelationBase(RelationBase element)

Parameters

element RelationBase

The relation to copy.

Remarks

This copy constructor creates copies of all value-typed properties. StorageColumns and Permissions from element are just added to the corresponding collections of the new Relation. No copying is performed.

Properties

DataType

Gets the type of the relation.

public Type DataType { get; }

Property Value

System.Type

IsNullable

Gets or sets a value indicating whether either Relation or ModelProperty can be null or not.

public abstract bool IsNullable { get; set; }

Property Value

System.Boolean

true if a Relation or ModelProperty can be null; otherwise, false.

Permissions

Gets the deny read write permissions of the ModelProperty.

public ModelCollection<Permission> Permissions { get; }

Property Value

ModelCollection<Permission>

Target

Gets or sets the target of the relation.

public abstract ModelEntityBase Target { get; set; }

Property Value

ModelEntityBase

Methods

Attach(ModelElement)

Attaches a model element to a parent model element.

protected override void Attach(ModelElement newParent)

Parameters

newParent ModelElement

Parent model element.

Remarks

Note to implementers: If your model element has sub-elements, your implementation of Attach should call the base class' implementation and afterwards attach all sub-elements.

Exceptions

System.ArgumentNullException

newParent is null.

System.ArgumentException

Thrown in case of a recursion in the model element tree.

InitializeObject()

Initializes the RelationBase object setting fields of the object to their default values.

protected virtual void InitializeObject()

RemovePermissions()

Empty the Permissions and EnabledPermissions.

protected void RemovePermissions()

ShallowCopy()

Performs a shallow copy of the current RelationBase/the derived class.

public abstract RelationBase ShallowCopy()

Returns

RelationBase

A shallow copy of the current RelationBase.

ShallowCopy(String, PersistBehavior, Ownership, Boolean, Boolean)

Performs a shallow copy of the current RelationBase/the derived class.

public abstract RelationBase ShallowCopy(string name, PersistBehavior persistBehavior, Ownership ownership, bool ignorePermissions = false, bool ignoreDefaultValues = false)

Parameters

name System.String

Overridden model element name.

persistBehavior PersistBehavior

Overridden persist behavior.

ownership Ownership

Overridden ownership.

ignorePermissions System.Boolean

if set to true [ignore permissions].

ignoreDefaultValues System.Boolean

if set to true [ignore default values].

Returns

RelationBase

A shallow copy of the current RelationBase.