Exemplo n.º 1
0
 /// <summary>
 /// Executes when a Stop command is sent to the service by the Service Control Manager (SCM).
 /// Specifies actions to take when a service stops running.
 /// </summary>
 protected override void OnStop()
 {
     if (_counter != null)
     {
         _counter.Dispose();
         _counter = null;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Executes when a Stop command is sent to the service by the Service Control Manager (SCM).
 /// Specifies actions to take when a service stops running.
 /// </summary>
 protected override void OnStop()
 {
     if (_counter != null)
     {
         _counter.Dispose();
         _counter = null;
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Executes when a Start command is sent to the service by the Service Control Manager (SCM)
        /// or when the operating system starts (for a service that starts automatically).
        /// Specifies actions to take when the service starts.
        /// </summary>
        /// <param name="args">Data passed by the start command.</param>
        protected override void OnStart(string[] args)
        {
            Logger.Info("Initialising Configuration");
            _counter = new MSMQCounter(
                ConfigurationManager.AppSettings["qName"],
                int.Parse(ConfigurationManager.AppSettings["interval"])
                );

            _counter.Enabled = true;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Executes when a Start command is sent to the service by the Service Control Manager (SCM)
        /// or when the operating system starts (for a service that starts automatically).
        /// Specifies actions to take when the service starts.
        /// </summary>
        /// <param name="args">Data passed by the start command.</param>
        protected override void OnStart(string[] args)
        {
            Logger.Info("Initialising Configuration");
            _counter = new MSMQCounter(
                ConfigurationManager.AppSettings["qName"],
                int.Parse(ConfigurationManager.AppSettings["interval"])
            );

            _counter.Enabled = true;
        }