public BackgroundJobListener(ITimerProvider timerProvider, IDatabase redisDatabase, string queueName) { this.queueName = queueName; this.startedQueueName = queueName + ".Started"; this.timerProvider = timerProvider; this.redisDatabase = redisDatabase; }
public CommandProvider(IDirectionManager directionManager, ITimerProvider timerProvider, Form form) { commands = new List <Command> { new StartTimerCommand(timerProvider, new[] { Keys.Left, Keys.Right, Keys.Up, Keys.Down }), new StopTimerCommand(timerProvider, new[] { Keys.Return }), new LeftDirectionCommand(directionManager, new[] { Keys.Left }), new RightDirectionCommand(directionManager, new[] { Keys.Right }), new UpDirectionCommand(directionManager, new[] { Keys.Up }), new DownDirectionCommand(directionManager, new[] { Keys.Down }), new NoneDirectionCommand(directionManager, new[] { Keys.Return }), new CenterCommand(form, new[] { Keys.Return }), }; }
public InMemoryCacheProvider(ITimerProvider timerProvider) { this.timerProvider = timerProvider; }
public InMemoryCache(ITimerProvider timerProvider) { this.timerProvider = timerProvider; Initialize(); }
public StopTimerCommand(ITimerProvider timerProvider, IEnumerable <Keys> keys) : base(timerProvider, keys) { }
public InMemoryCache(ITimerProvider timerProvider) { this.timerProvider = timerProvider; Initialize(); }
public TimerCommand(ITimerProvider timerProvider, IEnumerable <Keys> keys) : base(keys) { this.timerProvider = timerProvider; }
public InMemoryCacheProvider(ITimerProvider timerProvider) { this.timerProvider = timerProvider; }
public StartBootstrapper() { _config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); _settings = (Settings)_config.Sections["settings"]; Locator.CurrentMutable.RegisterConstant(_settings, typeof(Settings)); _customObservable2 = new CustomObservable2(); var schedulerProvider = new SchedulerProvider(); if (_settings.IsFakeService) { _client = new FakeServiceClientHelper(); } else { _client = new MainServiceClientHelper(_settings.ServiceUrl); } _trayIconManager = new TrayIconManager(); _trayIconManager.Init(); Locator.CurrentMutable.RegisterConstant(_customObservable2, typeof(ICustomObservable2)); Locator.CurrentMutable.RegisterConstant(schedulerProvider, typeof(ISchedulerProvider)); Locator.CurrentMutable.RegisterConstant(_config, typeof(Configuration)); Locator.CurrentMutable.RegisterConstant(_client, typeof(IMainServiceClientHelper)); Locator.CurrentMutable.RegisterConstant(_trayIconManager, typeof(TrayIconManager)); _timerProvider = new TimerProvider(); Locator.CurrentMutable.RegisterConstant(_timerProvider, typeof (ITimerProvider)); Locator.CurrentMutable.RegisterConstant(new CheckingVersionView(), typeof(IViewFor<CheckingVersionViewModel>)); Locator.CurrentMutable.RegisterConstant(new CheckingVersionErrorRetryingView(), typeof(IViewFor<CheckingVersionErrorRetryingViewModel>)); Locator.CurrentMutable.RegisterConstant(new CheckingUserKeyView(), typeof(IViewFor<CheckingUserKeyViewModel>)); Locator.CurrentMutable.RegisterConstant(new NewUserKeyView(), typeof(IViewFor<NewUserKeyViewModel>)); Locator.CurrentMutable.RegisterConstant(new CheckingUserKeyErrorRetryingView(), typeof(IViewFor<CheckingUserKeyErrorRetryingViewModel>)); Locator.CurrentMutable.RegisterConstant(new SuspendedView(), typeof(IViewFor<SuspendedViewModel>)); Locator.CurrentMutable.RegisterConstant(new UnknownErrorView(), typeof(IViewFor<UnknownErrorViewModel>)); Locator.CurrentMutable.RegisterConstant(new UnsupportedVersionView(), typeof(IViewFor<UnsupportedVersionViewModel>)); NewUserKeyViewModel.Submit.Subscribe(_ => { NewUserKeyViewModel.CanSubmit = false; ViewModel = CheckingUserKeyViewModel; HandleTryCheckUserKey(NewUserKeyViewModel.UserKey); }); ViewModel = CheckingVersionViewModel; TryCheckVersion().Subscribe(a => { if (a == CheckingVersionErrorRetryingViewModel) { _trayIconManager.SetIconType(NotifyIconType.Warning); } else if (a == UnknownErrorViewModel || a == UnsupportedVersionViewModel) { _trayIconManager.SetIconType(NotifyIconType.Error); } else { _trayIconManager.SetIconType(NotifyIconType.Idle); } ViewModel = a; if (a == CheckingUserKeyViewModel) { HandleTryCheckUserKey(_settings.UserKey); } }); }
public MainViewModel() { _settings = Locator.CurrentMutable.GetService<Settings>(); _customObservable2 = Locator.CurrentMutable.GetService<ICustomObservable2>(); _schedulerProvider = Locator.CurrentMutable.GetService<ISchedulerProvider>(); _client = Locator.CurrentMutable.GetService<IMainServiceClientHelper>(); _timerProvider = Locator.CurrentMutable.GetService<ITimerProvider>(); GameEnvironments = GetGameEnvironmentItems(); SelectedGameEnvironment = GameEnvironments.First(); LoadingScripts(); LoadingServers(); MatchOrdersRouting(); AddingRemovingMatchOrderItems(); SelectingScriptWhenServerIsSelected(); ClearingServerWhenScriptIsEditedOrSelected(); SubmittingCancellingMatchOrder(); RefreshMatchOrdersSummary = this.WhenAny(x => x.MatchOrdersSummaryViewModelBase.IsLoading, x => !x.Value).ToCommand(); this.WhenAnyValue(x => x.SelectedGameEnvironment).Subscribe(_ => { ScriptPart = null; Script = null; GameServerLoginPart = null; GameServer = null; PlayersMinCount = null; MatchOrdersSummaryViewModel.MatchOrdersSummaryItems.Clear(); MatchOrdersSummaryViewModelBase = MatchOrdersSummaryViewModel; }); LoadingMatchOrdersSummary(); LoadingScriptMatchOrdersSummary(); LoadingServerFilterMatchOrdersSummary(); IsJoinMatchesAutomatically = _settings.IsJoinMatchesAutomatically; this.WhenAnyValue(x => x.IsJoinMatchesAutomatically) .Subscribe(_ => { if (IsJoinMatchesAutomatically && string.IsNullOrWhiteSpace(_settings.GameFilePath)) { IsJoinMatchesAutomatically = false; MessageBus.Current.SendMessage(new BrowseGameFileEvent()); } _settings.IsJoinMatchesAutomatically = IsJoinMatchesAutomatically; }); _gameServerLoginPartDirectChangeObservable .Subscribe(_ => GameServer = null); }