Timer.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. //
  2. // System.Threading.Timer.cs
  3. //
  4. // Author:
  5. // Dick Porter ([email protected])
  6. //
  7. // (C) Ximian, Inc. http://www.ximian.com
  8. //
  9. namespace System.Threading
  10. {
  11. public sealed class Timer : IDisposable
  12. {
  13. public Timer(TimerCallback callback, object state, int dueTime, int period) {
  14. if(dueTime < -1) {
  15. throw new ArgumentOutOfRangeException("Due time < -1");
  16. }
  17. if(period < -1) {
  18. throw new ArgumentOutOfRangeException("Period < -1");
  19. }
  20. // FIXME
  21. }
  22. public Timer(TimerCallback callback, object state, long dueTime, long period) {
  23. if(dueTime < -1) {
  24. throw new ArgumentOutOfRangeException("Due time < -1");
  25. }
  26. if(period < -1) {
  27. throw new ArgumentOutOfRangeException("Period < -1");
  28. }
  29. // FIXME
  30. }
  31. public Timer(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period) {
  32. if(dueTime.Milliseconds < 0 || dueTime.Milliseconds > Int32.MaxValue) {
  33. throw new ArgumentOutOfRangeException("Due time out of range");
  34. }
  35. if(period.Milliseconds < 0 || period.Milliseconds > Int32.MaxValue) {
  36. throw new ArgumentOutOfRangeException("Period out of range");
  37. }
  38. // FIXME
  39. }
  40. [CLSCompliant(false)]
  41. public Timer(TimerCallback callback, object state, uint dueTime, uint period) {
  42. // FIXME
  43. }
  44. public bool Change(int dueTime, int period) {
  45. if(dueTime < -1) {
  46. throw new ArgumentOutOfRangeException("Due time < -1");
  47. }
  48. if(period < -1) {
  49. throw new ArgumentOutOfRangeException("Period < -1");
  50. }
  51. // FIXME
  52. return(false);
  53. }
  54. public bool Change(long dueTime, long period) {
  55. if(dueTime < -1) {
  56. throw new ArgumentOutOfRangeException("Due time < -1");
  57. }
  58. if(period < -1) {
  59. throw new ArgumentOutOfRangeException("Period < -1");
  60. }
  61. if(dueTime > 4294967294) {
  62. throw new NotSupportedException("Due time too large");
  63. }
  64. if(period > 4294967294) {
  65. throw new NotSupportedException("Period too large");
  66. }
  67. // FIXME
  68. return(false);
  69. }
  70. public bool Change(TimeSpan dueTime, TimeSpan period) {
  71. // FIXME
  72. return(false);
  73. }
  74. [CLSCompliant(false)]
  75. public bool Change(uint dueTime, uint period) {
  76. // FIXME
  77. return(false);
  78. }
  79. public void Dispose() {
  80. // FIXME
  81. }
  82. public bool Dispose(WaitHandle notifyObject) {
  83. // FIXME
  84. return(false);
  85. }
  86. ~Timer() {
  87. // FIXME
  88. }
  89. }
  90. }