示例#1
0
 /// <summary>
 /// Stop code goes here
 /// </summary>
 protected override void OnStop()
 {
     base.OnStop();
     if (_muninNode != null)
     {
         _muninNode.Stop();
     }
     _muninNode = null;
 }
示例#2
0
 /// <summary>
 /// Continue code goes here
 /// </summary>
 protected override void OnContinue()
 {
     base.OnContinue();
     try
     {
         _muninNode.Start();
     }
     catch (Exception e)
     {
         EventLog.WriteEntry(String.Format("Exception occured during startup: {0}", e.Message), EventLogEntryType.Error);
         _muninNode = null;
         ExitCode   = -1;
         Stop();
     }
 }
示例#3
0
        /// <summary>
        /// Startup code goes here
        /// </summary>
        /// <param name="args"></param>
        protected override void OnStart(string[] args)
        {
            ExitCode = 0;
            base.OnStart(args);

            _muninNode = new MuninNode(this);

            try
            {
                System.Threading.Tasks.Task.Factory.StartNew(_muninNode.Start);
            }
            catch (Exception e)
            {
                EventLog.WriteEntry(String.Format("Exception occured during startup: {0}", e.Message), EventLogEntryType.Error);
                _muninNode = null;
                ExitCode   = -1;
                Stop();
            }
        }