10 [__DynamicallyInvokable]
11 [HostProtection(
SecurityAction.LinkDemand, Synchronization =
true, ExternalThreading =
true)]
14 private const uint MAX_SUPPORTED_TIMEOUT = 4294967294u;
16 private TimerHolder m_timer;
26 [SecuritySafeCritical]
27 [__DynamicallyInvokable]
38 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
39 TimerSetup(callback, state, (uint)dueTime, (uint)period, ref stackMark);
50 [SecuritySafeCritical]
51 [__DynamicallyInvokable]
59 if (num > 4294967294u)
68 if (num2 > 4294967294u)
72 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
73 TimerSetup(callback, state, (uint)num, (uint)num2, ref stackMark);
85 [SecuritySafeCritical]
88 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
89 TimerSetup(callback, state, dueTime, period, ref stackMark);
100 [SecuritySafeCritical]
111 if (dueTime > 4294967294u)
115 if (period > 4294967294u)
119 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
120 TimerSetup(callback, state, (uint)dueTime, (uint)period, ref stackMark);
126 [SecuritySafeCritical]
131 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
132 TimerSetup(callback,
this, (uint)dueTime, (uint)period, ref stackMark);
136 private void TimerSetup(
TimerCallback callback,
object state, uint dueTime, uint period, ref StackCrawlMark stackMark)
138 if (callback ==
null)
142 m_timer =
new TimerHolder(
new TimerQueueTimer(callback, state, dueTime, period, ref stackMark));
146 internal static void Pause()
148 TimerQueue.Instance.Pause();
152 internal static void Resume()
154 TimerQueue.Instance.Resume();
164 [__DynamicallyInvokable]
165 public bool Change(
int dueTime,
int period)
175 return m_timer.m_timer.Change((uint)dueTime, (uint)period);
186 [__DynamicallyInvokable]
198 [CLSCompliant(
false)]
199 public bool Change(uint dueTime, uint period)
201 return m_timer.m_timer.Change(dueTime, period);
212 public bool Change(
long dueTime,
long period)
222 if (dueTime > 4294967294u)
226 if (period > 4294967294u)
230 return m_timer.m_timer.Change((uint)dueTime, (uint)period);
240 if (notifyObject ==
null)
244 return m_timer.Close(notifyObject);
248 [__DynamicallyInvokable]
254 internal void KeepRootedWhileScheduled()
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Encapsulates operating system–specific objects that wait for exclusive access to shared resources.
bool Change(uint dueTime, uint period)
Changes the start time and the interval between method invocations for a timer, using 32-bit unsigned...
static void SuppressFinalize(object obj)
Requests that the common language runtime not call the finalizer for the specified object.
Provides a mechanism for releasing unmanaged resources.To browse the .NET Framework source code for t...
Timer(TimerCallback callback, object state, long dueTime, long period)
Initializes a new instance of the Timer class, using 64-bit signed integers to measure time intervals...
The exception that is thrown when the value of an argument is outside the allowable range of values a...
double TotalMilliseconds
Gets the value of the current T:System.TimeSpan structure expressed in whole and fractional milliseco...
Timer(TimerCallback callback, object state, int dueTime, int period)
Initializes a new instance of the Timer class, using a 32-bit signed integer to specify the time inte...
void Dispose()
Releases all resources used by the current instance of T:System.Threading.Timer.
SecurityAction
Specifies the security actions that can be performed using declarative security.
Provides information about, and means to manipulate, the current environment and platform....
bool Change(long dueTime, long period)
Changes the start time and the interval between method invocations for a timer, using 64-bit signed i...
Timer(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period)
Initializes a new instance of the Timer class, using T:System.TimeSpan values to measure time interva...
delegate void TimerCallback(object state)
Represents the method that handles calls from a T:System.Threading.Timer.
Provides a mechanism for executing a method on a thread pool thread at specified intervals....
MethodImplOptions
Defines the details of how a method is implemented.
Timer(TimerCallback callback)
Initializes a new instance of the T:System.Threading.Timer class with an infinite period and an infin...
bool Dispose(WaitHandle notifyObject)
Releases all resources used by the current instance of T:System.Threading.Timer and signals when the ...
Timer(TimerCallback callback, object state, uint dueTime, uint period)
Initializes a new instance of the Timer class, using 32-bit unsigned integers to measure time interva...
Controls the system garbage collector, a service that automatically reclaims unused memory.
bool Change(int dueTime, int period)
Changes the start time and the interval between method invocations for a timer, using 32-bit signed i...
bool Change(TimeSpan dueTime, TimeSpan period)
Changes the start time and the interval between method invocations for a timer, using T:System....
Represents a time interval.To browse the .NET Framework source code for this type,...
Enables access to objects across application domain boundaries in applications that support remoting.