private static void RunAsService(string ServiceName) { try { Log.Informational("Starting service."); using (GatewayService Service = new GatewayService(ServiceName)) { ServiceBase.Run(Service); } } catch (Exception ex) { Log.Critical(ex); System.Runtime.ExceptionServices.ExceptionDispatchInfo.Capture(ex).Throw(); } finally { Log.Informational("Service terminated."); } }
public PendingTimer(GatewayService Service) { this.service = Service; this.timer = new Timer(this.MoreTime, null, 0, 1000); }