Exemplo n.º 1
0
 protected override void OnStart(string[] args)
 {
     Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
     _logger.WriteInfo(new LogMessage(string.Concat("OnStart receiver service ", ServiceName)), LogCategories);
     _receiverServiceBase = new ReceiverServiceBase(_logger);
     Task.Run(() => _receiverServiceBase.StartAsync().Wait());
 }
Exemplo n.º 2
0
 protected override void OnStop()
 {
     if (_receiverServiceBase != null)
     {
         _receiverServiceBase.Dispose();
         _receiverServiceBase = null;
     }
     _logger.WriteInfo(new LogMessage("Stopping service"), LogCategories);
     _logger = null;
 }