Esempio n. 1
0
        protected override void OnStart(string[] args)
        {
            _config = TeslaMergeConfig.GetConfig();

            _mainThread = new MergeThread(_config);

            _mainThread.Start();
        }
Esempio n. 2
0
        static int Main(string[] args)
        {
            if (!Environment.UserInteractive)
            {
                runAsService();
            }
            else
            {
                showHeader();

                TeslaMergeConfig config = TeslaMergeConfig.GetConfig();

                try
                {
                    if (args[0] == "-install")
                    {
                        installService();

                        return(SUCCESS);
                    }
                    else if (args[0] == "-uninstall")
                    {
                        uninstallService();

                        return(SUCCESS);
                    }
                    else if (args[0] == "-console")
                    {
                        runAsConsoleApplication(config);
                    }
                    else if (args.Length > 0)
                    {
                        showUsage();

                        return(SUCCESS);
                    }
                }
                catch
                {
                    Console.WriteLine("An unrecoverable problem was encountered - see event log for details.");

                    throw;
                }
            }

            return(SUCCESS);
        }