Exemplo n.º 1
0
        /// <summary>
        /// OnStart: Put startup code here
        ///  - Start threads, get inital data, etc.
        /// </summary>
        /// <param name="args"></param>
        protected override void OnStart(string[] args)
        {
            DateTime startTime = DateTime.Now;

            base.OnStart(args);
            try
            {
                new Agent("start").StartAgent();
            }
            catch (Exception ex)
            {
                DataFileHandler.sendToNotifnQ(DataFileHandler.getDTTZ() + "\tWarning\t" + Environment.MachineName + "\t OnStart()\tIssue in Starting Service " + ex.Message);
                ExceptionHandler.WritetoEventLog(DataFileHandler.getDTTZ() + "\tWarning\t" + Environment.MachineName + "\t OnStart()\tIssue in Starting Service " + ex.Message + ex.StackTrace);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// OnStop: Put your stop code here
 /// - Stop threads, set final data, etc.
 /// </summary>
 protected override void OnStop()
 {
     DataFileHandler.sendToNotifnQ(DataFileHandler.getDTTZ() + "\tWarning\t" + Environment.MachineName + "\tOnStop()\tService Stop Initiated");
     new Agent("stop").StopAgent();
     base.OnStop();
 }