DirectOuput Framework R2
DirectOutput framework R2 for virtual pinball cabinets
Go to:
Overview
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Properties
Events
Macros
Pages
ExtendDurationEffect.cs
Go to the documentation of this file.
1
using System;
2
using
DirectOutput.Table;
3
4
namespace
DirectOutput.FX.TimmedFX
5
{
11
public
class
ExtendDurationEffect
:
EffectEffectBase
12
{
13
private
int
_DurationMs = 500;
14
21
public
int
DurationMs
22
{
23
get
{
return
_DurationMs; }
24
set
{ _DurationMs = value.Limit(0,
int
.MaxValue); }
25
}
26
27
28
36
public
override
void
Trigger(
Table
.TableElementData
TableElementData
)
37
{
38
if
(TargetEffect != null)
39
{
40
if
(
TableElementData
.
Value
!= 0)
41
{
42
TriggerTargetEffect(
TableElementData
);
43
}
44
else
45
{
46
if
(DurationMs > 0)
47
{
48
Table
.
Pinball
.
Alarms
.RegisterAlarm(DurationMs, ExtendedDurationEnd,
TableElementData
,
true
);
49
}
50
else
51
{
52
TriggerTargetEffect(
TableElementData
);
53
}
54
}
55
56
}
57
}
58
59
60
private
void
ExtendedDurationEnd(
object
Data)
61
{
62
TriggerTargetEffect((
TableElementData
)Data);
63
}
64
65
70
public
override
void
Init(
Table
.
Table
Table
)
71
{
72
base.Init(
Table
);
73
}
74
79
public
override
void
Finish()
80
{
81
try
82
{
83
Table
.
Pinball
.
Alarms
.UnregisterAlarm(ExtendedDurationEnd);
84
}
85
catch
{ }
86
base.Finish();
87
}
88
89
}
90
}
DirectOutput
FX
TimmedFX
ExtendDurationEffect.cs
Generated on Sun Mar 29 2015 13:38:05 for DirectOuput Framework R2 by
1.8.3.1