2 // System.Threading.Timer.cs
5 // Dick Porter (dick@ximian.com)
7 // (C) Ximian, Inc. http://www.ximian.com
11 namespace System.Threading
13 public sealed class Timer : MarshalByRefObject, IDisposable
16 public Timer(TimerCallback callback, object state, int dueTime, int period) {
18 throw new ArgumentOutOfRangeException("Due time < -1");
21 throw new ArgumentOutOfRangeException("Period < -1");
28 public Timer(TimerCallback callback, object state, long dueTime, long period) {
30 throw new ArgumentOutOfRangeException("Due time < -1");
33 throw new ArgumentOutOfRangeException("Period < -1");
39 public Timer(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period) {
40 if(dueTime.Milliseconds < 0 || dueTime.Milliseconds > Int32.MaxValue) {
41 throw new ArgumentOutOfRangeException("Due time out of range");
43 if(period.Milliseconds < 0 || period.Milliseconds > Int32.MaxValue) {
44 throw new ArgumentOutOfRangeException("Period out of range");
49 [CLSCompliant(false)][MonoTODO]
50 public Timer(TimerCallback callback, object state, uint dueTime, uint period) {
55 public bool Change(int dueTime, int period) {
57 throw new ArgumentOutOfRangeException("Due time < -1");
60 throw new ArgumentOutOfRangeException("Period < -1");
67 public bool Change(long dueTime, long period) {
69 throw new ArgumentOutOfRangeException("Due time < -1");
72 throw new ArgumentOutOfRangeException("Period < -1");
74 if(dueTime > 4294967294) {
75 throw new NotSupportedException("Due time too large");
77 if(period > 4294967294) {
78 throw new NotSupportedException("Period too large");
85 public bool Change(TimeSpan dueTime, TimeSpan period) {
90 [CLSCompliant(false)][MonoTODO]
91 public bool Change(uint dueTime, uint period) {
97 public void Dispose() {
102 public bool Dispose(WaitHandle notifyObject) {