/// <summary> /// Stop code goes here /// </summary> protected override void OnStop() { base.OnStop(); if (_muninNode != null) { _muninNode.Stop(); } _muninNode = null; }
/// <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(); } }
/// <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(); } }