Пример #1
0
        void MmBotWorkerThread()
        {
            RobotRunner.Run(_options);

            _isStopped = true;

            _robotIsStopped.Set();
        }
Пример #2
0
        protected override void OnStop()
        {
            RobotRunner.Stop();

            _robotIsStopped.WaitOne(TimeSpan.FromSeconds(20));

            if (!_isStopped)
            {
                // robot didn't shutdown gracefully so we just kill the thread
                _thread.Abort();
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            var options = new Options();

            CommandLine.Parser.Default.ParseArguments(args, options);

            if (options.ShowHelp)
            {
                return;
            }

            //always cleanup if needed
            PackageDirCleaner.CleanUpPackages();


            if (options.RunAsService)
            {
                ServiceBase.Run(new ServiceBase[] { new Service(options) });
            }
            else
            {
                if (options.LastParserState != null && options.LastParserState.Errors.Any())
                {
                    return;
                }

                if (options.Parameters != null && options.Parameters.Any())
                {
                    options.Parameters.ForEach(Console.WriteLine);
                }

                if (options.Init)
                {
                    Initializer.InitializeCurrentDirectory();
                    return;
                }

                RobotRunner.Run(options);
            }
        }