Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Enabled

bool System.Timers.Timer.Enabled
getset

Definition at line 60 of file Timer.cs.

61 {
62 get
63 {
64 return _enabled;
65 }
66 set
67 {
68 if (base.DesignMode)
69 {
72 }
73 else if (_initializing)
74 {
76 }
77 else
78 {
79 if (_enabled == value)
80 {
81 return;
82 }
83 if (!value)
84 {
85 if (_timer != null)
86 {
87 _cookie = null;
88 _timer.Dispose();
89 _timer = null;
90 }
92 return;
93 }
95 if (_timer == null)
96 {
97 if (_disposed)
98 {
99 throw new ObjectDisposedException(GetType().Name);
100 }
101 int num = (int)Math.Ceiling(_interval);
102 _cookie = new object();
104 _timer.Change(num, _autoReset ? num : (-1));
105 }
106 else
107 {
108 UpdateTimer();
109 }
110 }
111 }
112 }
void UpdateTimer()
Definition Timer.cs:212
double _interval
Definition Timer.cs:11
bool _delayedEnable
Definition Timer.cs:17
System.Threading.Timer _timer
Definition Timer.cs:27
readonly TimerCallback _callback
Definition Timer.cs:29

Referenced by System.Timers.Timer.EndInit(), System.Timers.Timer.Start(), and System.Timers.Timer.Stop().