Пример #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;
            }
        }
Пример #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);
            }
        }
Пример #3
0
        public SlaveService(SlaveServer server)
        {
            if (server == null)
                throw new ArgumentNullException("server");

            this.server = server;

            ServiceName = "VMTool Slave";
        }
Пример #4
0
        public SlaveService(SlaveServer server)
        {
            if (server == null)
            {
                throw new ArgumentNullException("server");
            }

            this.server = server;

            ServiceName = "VMTool Slave";
        }