Timer.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. public Timer(TimerCallback callback, object state, uint dueTime, uint period) {
  41. // FIXME
  42. }
  43. public bool Change(int dueTime, int period) {
  44. if(dueTime < -1) {
  45. throw new ArgumentOutOfRangeException("Due time < -1");
  46. }
  47. if(period < -1) {
  48. throw new ArgumentOutOfRangeException("Period < -1");
  49. }
  50. // FIXME
  51. return(false);
  52. }
  53. public bool Change(long dueTime, long period) {
  54. if(dueTime < -1) {
  55. throw new ArgumentOutOfRangeException("Due time < -1");
  56. }
  57. if(period < -1) {
  58. throw new ArgumentOutOfRangeException("Period < -1");
  59. }
  60. if(dueTime > 4294967294) {
  61. throw new NotSupportedException("Due time too large");
  62. }
  63. if(period > 4294967294) {
  64. throw new NotSupportedException("Period too large");
  65. }
  66. // FIXME
  67. return(false);
  68. }
  69. public bool Change(TimeSpan dueTime, TimeSpan period) {
  70. // FIXME
  71. return(false);
  72. }
  73. public bool Change(uint dueTime, uint period) {
  74. // FIXME
  75. return(false);
  76. }
  77. public void Dispose() {
  78. // FIXME
  79. }
  80. public bool Dispose(WaitHandle notifyObject) {
  81. // FIXME
  82. return(false);
  83. }
  84. ~Timer() {
  85. // FIXME
  86. }
  87. }
  88. }