Class DataModelEvent
Represents a data model event without event arguments
public class DataModelEvent : IDataModelEvent
- Inheritance
-
objectDataModelEvent
- Implements
Constructors
DataModelEvent()
Creates a new instance of the DataModelEvent class with history tracking disabled
public DataModelEvent()
DataModelEvent(bool)
Creates a new instance of the DataModelEvent
public DataModelEvent(bool trackHistory)
Parameters
trackHistoryboolA boolean indicating whether the last 20 events should be tracked
Properties
ArgumentsType
Gets the type of arguments this event contains
public Type ArgumentsType { get; }
Property Value
EventArgumentsHistory
Gets a queue of the last 20 event arguments
Always empty if TrackHistory is false
public Queue<DataModelEventArgs> EventArgumentsHistory { get; }
Property Value
EventArgumentsHistoryUntyped
Gets a list of the last 20 event arguments by their base type.
Always empty if TrackHistory is false
public List<DataModelEventArgs> EventArgumentsHistoryUntyped { get; }
Property Value
LastEventArgumentsUntyped
Gets the event arguments of the last time the event was triggered by its base type
public DataModelEventArgs? LastEventArgumentsUntyped { get; }
Property Value
LastTrigger
Gets the last time the event was triggered
public DateTime LastTrigger { get; }
Property Value
LastTriggerArguments
Gets the event arguments of the last time the event was triggered
public DataModelEventArgs? LastTriggerArguments { get; }
Property Value
TimeSinceLastTrigger
Gets the time that has passed since the last trigger
public TimeSpan TimeSinceLastTrigger { get; }
Property Value
TrackHistory
Gets or sets a boolean indicating whether the last 20 events should be tracked
Note: setting this to false will clear the current history
public bool TrackHistory { get; set; }
Property Value
TriggerCount
Gets the amount of times the event was triggered
public int TriggerCount { get; }
Property Value
TriggerPastParticiple
Gets the past participle for this event shown in the UI
public string TriggerPastParticiple { get; }
Property Value
Methods
Reset()
Resets the trigger count and history of this data model event
public void Reset()
Trigger()
Trigger the event
public void Trigger()
Update()
Updates the event, not required for standard events but included in case your custom event needs to update every tick
public void Update()
Events
EventTriggered
Fires when the event is triggered
public event EventHandler? EventTriggered