Esempio n. 1
0
 /// <summary>
 /// Tests service in console
 /// </summary>
 void Test()
 {
     Config.TestMode = true;
     Console.WindowWidth = 160;
     Console.WindowHeight = 50;
     Console.Write(InfoString);
     Console.WriteLine(Messages.InitializingService);
     var service = new WinService();
     Console.WriteLine(Messages.Starting);
     service.Start();
     Console.ReadKey(true);
     service.Shutdown();
     Console.WriteLine(Messages.Done);
 }
Esempio n. 2
0
 /// <summary>
 /// Service class constructor
 /// </summary>
 public WinService()
 {
     Log.EventLog = EventLog;
     EventLog.Log = Config.Company;
     EventLog.Source = Config.DisplayName;
     ServiceName = Config.ServiceName;
     CanPauseAndContinue = false;
     CanShutdown = true;
     ZapTimer = new Timer(179000);
     ZapTimer.Elapsed += ZapTimer_Elapsed;
     Instance = this;
 }