Ejemplo n.º 1
0
        public ApiRouter(
            ApiThrottler apiThrottler,
            IOptionsService optionsService,
            IBellService bellService,
            ITalkTimerService timerService,
            ITalkScheduleService talksService,
            IDateTimeService dateTimeService)
        {
            _apiThrottler    = apiThrottler;
            _optionsService  = optionsService;
            _dateTimeService = dateTimeService;

            _timersApiController = new Lazy <TimersApiController>(() =>
                                                                  new TimersApiController(timerService, talksService, _optionsService, _apiThrottler));

            _dateTimeApiController = new Lazy <DateTimeApiController>(() =>
                                                                      new DateTimeApiController(_apiThrottler));

            _bellApiController = new Lazy <BellApiController>(() =>
                                                              new BellApiController(_optionsService, bellService, _apiThrottler));

            _systemApiController = new Lazy <SystemApiController>(() =>
                                                                  new SystemApiController(_optionsService, _apiThrottler));

            _webHooksApiController = new Lazy <WebHooksApiController>(() =>
                                                                      new WebHooksApiController());
        }
Ejemplo n.º 2
0
        public OperatorPageViewModel(
            ITalkTimerService timerService,
            ITalkScheduleService scheduleService,
            IAdaptiveTimerService adaptiveTimerService,
            IOptionsService optionsService)
        {
            _scheduleService                 = scheduleService;
            _optionsService                  = optionsService;
            _adaptiveTimerService            = adaptiveTimerService;
            _timerService                    = timerService;
            _timerService.TimerChangedEvent += TimerChangedHandler;

            SelectFirstTalk();

            _talkTitle = _unknownTalkTitle;

            StartCommand            = new RelayCommand(StartTimer, () => IsNotRunning);
            StopCommand             = new RelayCommand(StopTimer, () => IsRunning);
            SettingsCommand         = new RelayCommand(NavigateSettings, () => IsNotRunning);
            IncrementTimerCommand   = new RelayCommand(IncrementTimer, CanIncreaseTimerValue);
            IncrementTimer15Command = new RelayCommand(IncrementTimer15Secs, CanIncreaseTimerValue);
            IncrementTimer5Command  = new RelayCommand(IncrementTimer5Mins, CanIncreaseTimerValue);
            DecrementTimerCommand   = new RelayCommand(DecrementTimer, CanDecreaseTimerValue);
            DecrementTimer15Command = new RelayCommand(DecrementTimer15Secs, CanDecreaseTimerValue);
            DecrementTimer5Command  = new RelayCommand(DecrementTimer5Mins, CanDecreaseTimerValue);
            BellToggleCommand       = new RelayCommand(BellToggle);

            // subscriptions...
            Messenger.Default.Register <OperatingModeChangedMessage>(this, OnOperatingModeChanged);
            Messenger.Default.Register <AutoMeetingChangedMessage>(this, OnAutoMeetingChanged);
        }
Ejemplo n.º 3
0
 public AutomateService(
     IOptionsService optionsService,
     ITalkTimerService timerService,
     ITalkScheduleService scheduleService)
 {
     _optionsService  = optionsService;
     _timerService    = timerService;
     _scheduleService = scheduleService;
 }
Ejemplo n.º 4
0
        public AdaptiveTimerService(
            IOptionsService optionsService,
            ITalkScheduleService scheduleService)
        {
            _optionsService  = optionsService;
            _scheduleService = scheduleService;

            Messenger.Default.Register <CountdownWindowStatusChangedMessage>(this, OnCountdownWindowStatusChanged);
        }
Ejemplo n.º 5
0
 public TimersApiController(
     ITalkTimerService timerService,
     ITalkScheduleService talkScheduleService,
     IOptionsService optionsService,
     ApiThrottler apiThrottler)
 {
     _timerService        = timerService;
     _talkScheduleService = talkScheduleService;
     _optionsService      = optionsService;
     _apiThrottler        = apiThrottler;
 }
Ejemplo n.º 6
0
        public HttpServer(
            IOptionsService optionsService,
            IBellService bellService,
            ITalkTimerService timerService,
            ITalkScheduleService talksService)
        {
            _optionsService = optionsService;

            _apiThrottler = new ApiThrottler(optionsService);

            _apiRouter = new ApiRouter(_apiThrottler, _optionsService, bellService, timerService, talksService);
        }
Ejemplo n.º 7
0
        public HttpServer(
            IOptionsService optionsService,
            IBellService bellService,
            ITalkTimerService timerService,
            ITalkScheduleService talksService)
        {
            _optionsService = optionsService;

            _clock24Hour  = new DateTime(1, 1, 1, 23, 1, 1).ToShortTimeString().Contains("23");
            _apiThrottler = new ApiThrottler(optionsService);

            _apiRouter = new ApiRouter(_apiThrottler, _optionsService, bellService, timerService, talksService);
        }
Ejemplo n.º 8
0
        public OperatorPageViewModel(
            ITalkTimerService timerService,
            ITalkScheduleService scheduleService,
            IAdaptiveTimerService adaptiveTimerService,
            IOptionsService optionsService,
            ICommandLineService commandLineService,
            IBellService bellService)
        {
            _scheduleService                 = scheduleService;
            _optionsService                  = optionsService;
            _adaptiveTimerService            = adaptiveTimerService;
            _commandLineService              = commandLineService;
            _bellService                     = bellService;
            _timerService                    = timerService;
            _timerService.TimerChangedEvent += TimerChangedHandler;
            _countUp = _optionsService.Options.CountUp;

            SelectFirstTalk();

            _timerService.TimerStartStopFromApiEvent += HandleTimerStartStopFromApi;

            // commands...
            StartCommand            = new RelayCommand(StartTimer, () => IsNotRunning && IsValidTalk, true);
            StopCommand             = new RelayCommand(StopTimer, () => IsRunning);
            SettingsCommand         = new RelayCommand(NavigateSettings, () => IsNotRunning && !_commandLineService.NoSettings);
            HelpCommand             = new RelayCommand(LaunchHelp);
            NewVersionCommand       = new RelayCommand(DisplayNewVersionPage);
            IncrementTimerCommand   = new RelayCommand(IncrementTimer, CanIncreaseTimerValue);
            IncrementTimer15Command = new RelayCommand(IncrementTimer15Secs, CanIncreaseTimerValue);
            IncrementTimer5Command  = new RelayCommand(IncrementTimer5Mins, CanIncreaseTimerValue);
            DecrementTimerCommand   = new RelayCommand(DecrementTimer, CanDecreaseTimerValue);
            DecrementTimer15Command = new RelayCommand(DecrementTimer15Secs, CanDecreaseTimerValue);
            DecrementTimer5Command  = new RelayCommand(DecrementTimer5Mins, CanDecreaseTimerValue);
            BellToggleCommand       = new RelayCommand(BellToggle);
            CountUpToggleCommand    = new RelayCommand(CountUpToggle);
            CloseCountdownCommand   = new RelayCommand(CloseCountdownWindow);

            // subscriptions...
            Messenger.Default.Register <OperatingModeChangedMessage>(this, OnOperatingModeChanged);
            Messenger.Default.Register <AutoMeetingChangedMessage>(this, OnAutoMeetingChanged);
            Messenger.Default.Register <CountdownWindowStatusChangedMessage>(this, OnCountdownWindowStatusChanged);
            Messenger.Default.Register <ShowCircuitVisitToggleChangedMessage>(this, OnShowCircuitVisitToggleChanged);

            if (IsInDesignMode)
            {
                IsNewVersionAvailable = true;
            }

            GetVersionData();
        }
Ejemplo n.º 9
0
        public TimersResponseData(
            ITalkScheduleService talkService,
            ITalkTimerService timerService,
            IOptionsService optionsService)
        {
            var talks = talkService.GetTalkScheduleItems();

            Status = timerService.GetStatus();

            TimerInfo = new List <TimerInfo>();

            var countUpByDefault = optionsService.Options.CountUp;

            foreach (var talk in talks)
            {
                TimerInfo.Add(CreateTimerInfo(talk, countUpByDefault));
            }
        }
Ejemplo n.º 10
0
        public TimersResponseData(
            ITalkScheduleService talkService,
            ITalkTimerService timerService,
            IOptionsService optionsService,
            int talkId)
        {
            var talks = talkService.GetTalkScheduleItems();
            var talk  = talks.SingleOrDefault(x => x.Id == talkId);

            if (talk == null)
            {
                throw new WebServerException(WebServerErrorCode.TimerDoesNotExist);
            }

            Status    = timerService.GetStatus();
            TimerInfo = new List <TimerInfo> {
                CreateTimerInfo(talk, optionsService.Options.CountUp)
            };
        }
Ejemplo n.º 11
0
 public AdaptiveTimerService(IOptionsService optionsService, ITalkScheduleService scheduleService)
 {
     _optionsService  = optionsService;
     _scheduleService = scheduleService;
 }