コード例 #1
0
        public static IRunner CreateRunner(ITimeMaster timeMaster, IOutput output, ServiceDef[] services, bool autoStart)
        {
            RunnerImpl i = new RunnerImpl(timeMaster, output, services);

            if (autoStart)
            {
                i.Start();
            }

            return(i);
        }
コード例 #2
0
ファイル: RunnerImpl.cs プロジェクト: Wihiss/ServicesChecker
        internal RunnerImpl(ITimeMaster timeMaster, IOutput outputService, ServiceDef[] services)
        {
            if (timeMaster == null)
            {
                throw new ArgumentNullException(nameof(timeMaster));
            }
            if (outputService == null)
            {
                throw new ArgumentNullException(nameof(outputService));
            }
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }

            _timeMaster    = timeMaster;
            _outputService = outputService;
            _startStopLock = new object();

            _serviceCheckers = new List <ServiceCheckerContainer>();

            InitServiceCheckers(services);
        }