Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. public static class ServiceGlobals // Globals
  2. {
  3.  
  4. public static System.Timers.Timer _timer = new System.Timers.Timer();
  5. }
  6.  
  7. protected override void OnStart(string[] args)
  8. {
  9.  
  10. ServiceGlobals._timer.AutoReset = false;
  11. ServiceGlobals._timer.Interval = (3000);
  12. ServiceGlobals._timer.Elapsed += new System.Timers.ElapsedEventHandler(_timer_Elapsed);
  13. ServiceGlobals._timer.Enabled = true;
  14. ServiceGlobals._timer.Start(); // Start timer
  15. }
  16.  
  17. if (ServiceGlobals._timer.Enabled) // Check if the timer is running
  18. {
  19. // Return error.........
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement