Class Trigger
A class that represents a trigger that can be either executed before a save operation occurs or afterwards.
Implements
Inherited Members
Namespace: TimeCockpit.Data.DataModel.Triggers
Assembly: TimeCockpit.Data.dll
Syntax
public class Trigger : ModelElement, IDynamicMetaObjectProvider, INotifyPropertyChanged, IDataErrorInfo
Constructors
Trigger()
Initializes a new instance of the Trigger class.
Declaration
public Trigger()
Trigger(IEnumerable<KeyValuePair<Object, Object>>)
Initializes a new instance of the Trigger class.
Declaration
public Trigger(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. |
Trigger(Trigger)
Initializes a new instance of the Trigger class.
Declaration
public Trigger(Trigger element)
Parameters
Type | Name | Description |
---|---|---|
Trigger | element | The trigger to copy. |
Remarks
This copy constructor creates copies of all value-typed properties.
Properties
Binding
Gets or sets the assembly binding.
Declaration
public ModelActionBinding Binding { get; set; }
Property Value
Type | Description |
---|---|
ModelActionBinding |
Remarks
The instance of Binding holds a references to some piece of executabe .NET code.
ExecutionMode
Gets or sets the execution mode of the trigger.
Declaration
public TriggerExecutionMode ExecutionMode { get; set; }
Property Value
Type | Description |
---|---|
TriggerExecutionMode |
ExecutionTime
Gets or sets the execution time when the trigger is fired.
Declaration
public TriggerExecutionTime ExecutionTime { get; set; }
Property Value
Type | Description |
---|---|
TriggerExecutionTime |
IsDisabled
Gets or sets a value indicating whether this instance is disabled.
Declaration
public bool IsDisabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
TriggerType
Gets or sets the type of the trigger.
Declaration
public TriggerType TriggerType { get; set; }
Property Value
Type | Description |
---|---|
TriggerType |
UseTransaction
Gets or sets a value indicating whether a transaction should be used for the trigger or not.
Declaration
public bool UseTransaction { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
Accept(ModelElementVisitor)
Dispatches the visit handler for a trigger.
Declaration
public override void Accept(ModelElementVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
ModelElementVisitor | visitor | the trigger visitor. |
Overrides
Execute(ExecutionContext)
Executes the code the Binding is associated with.
Declaration
public void Execute(ExecutionContext executionContext)
Parameters
Type | Name | Description |
---|---|---|
ExecutionContext | executionContext | The execution context. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown if it is tried to executed a disabled trigger. |