/// <summary> /// The main entry point for the application. /// </summary> static int Main(string[] args) { try { var options = new SlaveOptions(); var parser = new CommandLineParser(); var helpWriter = new StringWriter(); if (!parser.ParseArguments(args, options, helpWriter)) { MessageBox.Show(helpWriter.ToString(), "VMTool Slave"); return 1; } var server = new SlaveServer(options); if (options.Debug) { GlobalContext.Properties["LogToConsole"] = "true"; server.Run(); } else { ServiceBase.Run(new SlaveService(server)); } return 0; } catch (Exception ex) { log.Fatal("Fatal exception.", ex); return 1; } }
/// <summary> /// The main entry point for the application. /// </summary> static int Main(string[] args) { try { var options = new SlaveOptions(); var parser = new CommandLineParser(); var helpWriter = new StringWriter(); if (!parser.ParseArguments(args, options, helpWriter)) { MessageBox.Show(helpWriter.ToString(), "VMTool Slave"); return(1); } var server = new SlaveServer(options); if (options.Debug) { GlobalContext.Properties["LogToConsole"] = "true"; server.Run(); } else { ServiceBase.Run(new SlaveService(server)); } return(0); } catch (Exception ex) { log.Fatal("Fatal exception.", ex); return(1); } }
public SlaveService(SlaveServer server) { if (server == null) throw new ArgumentNullException("server"); this.server = server; ServiceName = "VMTool Slave"; }
public SlaveService(SlaveServer server) { if (server == null) { throw new ArgumentNullException("server"); } this.server = server; ServiceName = "VMTool Slave"; }