private static void RunCommandLine() { ActionManager actionManager = null; AddCommandLineLogger(); log.Info("Running in command-line mode."); try { actionManager = new ActionManager(); actionManager.Start(); Console.WriteLine("Press enter to stop...."); Console.ReadLine(); actionManager.Stop(); } catch (Exception ex) { log.Error(ex.ToString()); Console.WriteLine("Press enter to stop...."); Console.ReadLine(); } if (actionManager != null) { actionManager.Dispose(); } }
public WindowsService() { InitializeComponent(); actionManager = new ActionManager(); }