Class RelationBase
Base class for relations (with storage) and virtual relations (with conditions).
Inheritance
Implements
Inherited Members
Namespace: TimeCockpit.Data.DataModel
Assembly: TimeCockpit.Data.dll
Syntax
public abstract class RelationBase : ModelElement, IDynamicMetaObjectProvider, INotifyPropertyChanged, IDataErrorInfo, INullable
Constructors
RelationBase()
Initializes a new instance of the RelationBase class.
Declaration
public RelationBase()
RelationBase(IEnumerable<KeyValuePair<Object, Object>>)
Initializes a new instance of the RelationBase class.
Declaration
public RelationBase(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 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.
Declaration
public RelationBase(RelationBase element)
Parameters
Type | Name | Description |
---|---|---|
RelationBase | element | 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.
Declaration
public Type DataType { get; }
Property Value
Type | Description |
---|---|
System.Type |
IsNullable
Gets or sets a value indicating whether either Relation or ModelProperty can be null or not.
Declaration
public abstract bool IsNullable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Implements
Permissions
Gets the deny read write permissions of the ModelProperty.
Declaration
public ModelCollection<Permission> Permissions { get; }
Property Value
Type | Description |
---|---|
ModelCollection<Permission> |
Target
Gets or sets the target of the relation.
Declaration
public abstract ModelEntityBase Target { get; set; }
Property Value
Type | Description |
---|---|
ModelEntityBase |
Methods
Attach(ModelElement)
Attaches a model element to a parent model element.
Declaration
protected override void Attach(ModelElement newParent)
Parameters
Type | Name | Description |
---|---|---|
ModelElement | newParent | Parent model element. |
Overrides
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
Type | Condition |
---|---|
System.ArgumentNullException |
|
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.
Declaration
protected virtual void InitializeObject()
RemovePermissions()
Empty the Permissions and EnabledPermissions.
Declaration
protected void RemovePermissions()
ShallowCopy()
Performs a shallow copy of the current RelationBase/the derived class.
Declaration
public abstract RelationBase ShallowCopy()
Returns
Type | Description |
---|---|
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.
Declaration
public abstract RelationBase ShallowCopy(string name, PersistBehavior persistBehavior, Ownership ownership, bool ignorePermissions = false, bool ignoreDefaultValues = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Overridden model element name. |
PersistBehavior | persistBehavior | Overridden persist behavior. |
Ownership | ownership | Overridden ownership. |
System.Boolean | ignorePermissions | if set to |
System.Boolean | ignoreDefaultValues | if set to |
Returns
Type | Description |
---|---|
RelationBase | A shallow copy of the current RelationBase. |