Esempio n. 1
0
        /// <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;
            }
        }
Esempio n. 2
0
        /// <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);
            }
        }
Esempio n. 3
0
        public SlaveService(SlaveServer server)
        {
            if (server == null)
                throw new ArgumentNullException("server");

            this.server = server;

            ServiceName = "VMTool Slave";
        }
Esempio n. 4
0
        public SlaveService(SlaveServer server)
        {
            if (server == null)
            {
                throw new ArgumentNullException("server");
            }

            this.server = server;

            ServiceName = "VMTool Slave";
        }