DirectOutput
DirectOutput framework R3 for virtual pinball cabinets.
Loading...
Searching...
No Matches
DirectOutput.PinballSupport.AlarmHandler Class Reference

The AlarmHandler classed is used to execute scheduled events (e.g. regular updates on a effect) in the framework.
Two types of alarms/scheduled events exist:
More...

Public Member Functions

DateTime GetNextAlarmTime ()
 Gets the time when the next alarm (interval or single) is scheduled.
bool ExecuteAlarms (DateTime AlarmTime)
 Executes all Alarms which have expired until the specified AlarmTime..
void RegisterIntervalAlarm (int IntervalMs, Action IntervalAlarmHandler)
 Registers the method specified in IntervalAlarmHandler for interval alarms.
Interval alarms are fired repeatedly at the specified interval. Please note that the interval is likely not absolutely precise.
void UnregisterIntervalAlarm (Action IntervalAlarmHandler)
 Unregisters the specified IntervalAlarmHandler.
void RegisterIntervalAlarm (int IntervalMs, Action< object > IntervalAlarmHandler, object Parameter)
 Registers the method specified in IntervalAlarmHandler for interval alarms.
Interval alarms are fired repeatedly at the specified interval. Please note that the interval is likely not absolutely precise.
void UnregisterIntervalAlarm (Action< object > IntervalAlarmHandler)
 Unregisters the specified IntervalAlarmHandler.
void RegisterAlarm (int DurationMs, Action AlarmHandler, bool DoNotUnregister=false)
 Registers the specified AlarmHandler for a alarm after the specified duration.
void RegisterAlarm (DateTime AlarmTime, Action AlarmHandler, bool DoNotUnregister=false)
 Registers the specified AlarmHandler for a alarm at the certain time.
void UnregisterAlarm (Action AlarmHandler)
 Unregisters all alarm for the specified alarm handler.
void RegisterAlarm (int DurationMs, Action< object > AlarmHandler, object Parameter, bool DoNotUnregister=false)
 Registers the specified AlarmHandler for a alarm after the specified duration.
void RegisterAlarm (DateTime AlarmTime, Action< object > AlarmHandler, object Parameter, bool DoNotUnregister=false)
 Registers the specified AlarmHandler for a alarm at the certain time.
void UnregisterAlarm (Action< object > AlarmHandler)
 Unregisters all alarms for the specified alarm handler.
void Init (Pinball Pinball)
 Initializes the object.

void Finish ()
 Finishes the object. Clears all alarm lists.
 AlarmHandler ()
 Initializes a new instance of the AlarmHandler class.

Detailed Description

The AlarmHandler classed is used to execute scheduled events (e.g. regular updates on a effect) in the framework.
Two types of alarms/scheduled events exist:

  • Alarm which only executes once
  • IntervalAlarm which executes at specified intervals until the alarm is unregistered.

Constructor & Destructor Documentation

◆ AlarmHandler()

DirectOutput.PinballSupport.AlarmHandler.AlarmHandler ( )

Initializes a new instance of the AlarmHandler class.

Member Function Documentation

◆ ExecuteAlarms()

bool DirectOutput.PinballSupport.AlarmHandler.ExecuteAlarms ( DateTime AlarmTime)

Executes all Alarms which have expired until the specified AlarmTime..

Parameters
AlarmTimeThe alarm time.
Returns
true if alarms have been executed, false if no alarms have been executed.

◆ Finish()

void DirectOutput.PinballSupport.AlarmHandler.Finish ( )

Finishes the object. Clears all alarm lists.

◆ GetNextAlarmTime()

DateTime DirectOutput.PinballSupport.AlarmHandler.GetNextAlarmTime ( )

Gets the time when the next alarm (interval or single) is scheduled.

Returns
DateTime for the next alarm. If no alarms are scheduled the MaxValue for DateTime is returned.

◆ Init()

void DirectOutput.PinballSupport.AlarmHandler.Init ( Pinball Pinball)

Initializes the object.

◆ RegisterAlarm() [1/4]

void DirectOutput.PinballSupport.AlarmHandler.RegisterAlarm ( DateTime AlarmTime,
Action AlarmHandler,
bool DoNotUnregister = false )

Registers the specified AlarmHandler for a alarm at the certain time.

Parameters
AlarmTimeThe alarm time.
AlarmHandlerThe alarm handler.
DoNotUnregisterIf set to true, previously registered alarms for the same AlarmHandler will not be unregistered. If set to false, previously registered alarms for the same AlarmHandler will be unregistered.

◆ RegisterAlarm() [2/4]

void DirectOutput.PinballSupport.AlarmHandler.RegisterAlarm ( DateTime AlarmTime,
Action< object > AlarmHandler,
object Parameter,
bool DoNotUnregister = false )

Registers the specified AlarmHandler for a alarm at the certain time.

Parameters
AlarmTimeThe alarm time.
AlarmHandlerThe alarm handler.
ParameterThe parameter value for the alarm.
DoNotUnregisterIf set to true previously registered alarms for the same handler are no unregistered before registering the handler.

◆ RegisterAlarm() [3/4]

void DirectOutput.PinballSupport.AlarmHandler.RegisterAlarm ( int DurationMs,
Action AlarmHandler,
bool DoNotUnregister = false )

Registers the specified AlarmHandler for a alarm after the specified duration.

Parameters
DurationMsThe duration until the alarm fires in milliseconds.
AlarmHandlerThe alarm handler.
DoNotUnregisterIf set to true previously registered alarms for the same handler are no unregistered before registering the handler.

◆ RegisterAlarm() [4/4]

void DirectOutput.PinballSupport.AlarmHandler.RegisterAlarm ( int DurationMs,
Action< object > AlarmHandler,
object Parameter,
bool DoNotUnregister = false )

Registers the specified AlarmHandler for a alarm after the specified duration.

Parameters
DurationMsThe duration until the alarm fires in milliseconds.
AlarmHandlerThe alarm handler.
ParameterThe parameter value for the alarm.
DoNotUnregisterIf set to true previously registered alarms for the same handler are no unregistered before registering the handler.

◆ RegisterIntervalAlarm() [1/2]

void DirectOutput.PinballSupport.AlarmHandler.RegisterIntervalAlarm ( int IntervalMs,
Action IntervalAlarmHandler )

Registers the method specified in IntervalAlarmHandler for interval alarms.
Interval alarms are fired repeatedly at the specified interval. Please note that the interval is likely not absolutely precise.

Parameters
IntervalMsThe alarm interval in milliseconds.
IntervalAlarmHandlerThe handler for the alarm (delegate of parameterless method).

◆ RegisterIntervalAlarm() [2/2]

void DirectOutput.PinballSupport.AlarmHandler.RegisterIntervalAlarm ( int IntervalMs,
Action< object > IntervalAlarmHandler,
object Parameter )

Registers the method specified in IntervalAlarmHandler for interval alarms.
Interval alarms are fired repeatedly at the specified interval. Please note that the interval is likely not absolutely precise.

Parameters
IntervalMsThe alarm interval in milliseconds.
IntervalAlarmHandlerThe handler for the alarm (delegate of method with one parameter of type object).
ParameterThe parameter for the interval alarm.

◆ UnregisterAlarm() [1/2]

void DirectOutput.PinballSupport.AlarmHandler.UnregisterAlarm ( Action AlarmHandler)

Unregisters all alarm for the specified alarm handler.

Parameters
AlarmHandlerThe alarm handler.

◆ UnregisterAlarm() [2/2]

void DirectOutput.PinballSupport.AlarmHandler.UnregisterAlarm ( Action< object > AlarmHandler)

Unregisters all alarms for the specified alarm handler.

Parameters
AlarmHandlerThe alarm handler.

◆ UnregisterIntervalAlarm() [1/2]

void DirectOutput.PinballSupport.AlarmHandler.UnregisterIntervalAlarm ( Action IntervalAlarmHandler)

Unregisters the specified IntervalAlarmHandler.

Parameters
IntervalAlarmHandlerThe interval alarm handler.

◆ UnregisterIntervalAlarm() [2/2]

void DirectOutput.PinballSupport.AlarmHandler.UnregisterIntervalAlarm ( Action< object > IntervalAlarmHandler)

Unregisters the specified IntervalAlarmHandler.

Parameters
IntervalAlarmHandlerThe interval alarm handler.

The documentation for this class was generated from the following file:
  • D:/a/DirectOutput/DirectOutput/DirectOutput/PinballSupport/AlarmHandler.cs