2
0

Timer.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 : MarshalByRefObject, IDisposable
  12. {
  13. [MonoTODO]
  14. public Timer(TimerCallback callback, object state, int dueTime, int period) {
  15. if(dueTime < -1) {
  16. throw new ArgumentOutOfRangeException("Due time < -1");
  17. }
  18. if(period < -1) {
  19. throw new ArgumentOutOfRangeException("Period < -1");
  20. }
  21. // FIXME
  22. }
  23. [MonoTODO]
  24. public Timer(TimerCallback callback, object state, long dueTime, long period) {
  25. if(dueTime < -1) {
  26. throw new ArgumentOutOfRangeException("Due time < -1");
  27. }
  28. if(period < -1) {
  29. throw new ArgumentOutOfRangeException("Period < -1");
  30. }
  31. // FIXME
  32. }
  33. [MonoTODO]
  34. public Timer(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period) {
  35. if(dueTime.Milliseconds < 0 || dueTime.Milliseconds > Int32.MaxValue) {
  36. throw new ArgumentOutOfRangeException("Due time out of range");
  37. }
  38. if(period.Milliseconds < 0 || period.Milliseconds > Int32.MaxValue) {
  39. throw new ArgumentOutOfRangeException("Period out of range");
  40. }
  41. // FIXME
  42. }
  43. [CLSCompliant(false)][MonoTODO]
  44. public Timer(TimerCallback callback, object state, uint dueTime, uint period) {
  45. // FIXME
  46. }
  47. [MonoTODO]
  48. public bool Change(int dueTime, int period) {
  49. if(dueTime < -1) {
  50. throw new ArgumentOutOfRangeException("Due time < -1");
  51. }
  52. if(period < -1) {
  53. throw new ArgumentOutOfRangeException("Period < -1");
  54. }
  55. // FIXME
  56. return(false);
  57. }
  58. [MonoTODO]
  59. public bool Change(long dueTime, long period) {
  60. if(dueTime < -1) {
  61. throw new ArgumentOutOfRangeException("Due time < -1");
  62. }
  63. if(period < -1) {
  64. throw new ArgumentOutOfRangeException("Period < -1");
  65. }
  66. if(dueTime > 4294967294) {
  67. throw new NotSupportedException("Due time too large");
  68. }
  69. if(period > 4294967294) {
  70. throw new NotSupportedException("Period too large");
  71. }
  72. // FIXME
  73. return(false);
  74. }
  75. [MonoTODO]
  76. public bool Change(TimeSpan dueTime, TimeSpan period) {
  77. // FIXME
  78. return(false);
  79. }
  80. [CLSCompliant(false)][MonoTODO]
  81. public bool Change(uint dueTime, uint period) {
  82. // FIXME
  83. return(false);
  84. }
  85. [MonoTODO]
  86. public void Dispose() {
  87. // FIXME
  88. }
  89. [MonoTODO]
  90. public bool Dispose(WaitHandle notifyObject) {
  91. // FIXME
  92. return(false);
  93. }
  94. [MonoTODO]
  95. ~Timer() {
  96. // FIXME
  97. }
  98. }
  99. }