Example #1
0
        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.");
            }
        }
Example #2
0
 public PendingTimer(GatewayService Service)
 {
     this.service = Service;
     this.timer   = new Timer(this.MoreTime, null, 0, 1000);
 }