Exemple #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(
            IApplicationBuilder app,
            IWebHostEnvironment env,
            ILogger <Startup> logger,
            IBackgroundWorkerService backgroundWorkerService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseSwagger();
                app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "WebAPI v1"));
            }

            app.UseHangfireServer();
            app.UseHangfireDashboard("/hangfire", new DashboardOptions {
                Authorization = new[] { new HangfireDashboardAuthorizationFilter() }
            });

            app.UseHttpsRedirection();

            app.UseRouting();

            backgroundWorkerService.Enqueue <IEmailConsumer>(emailConsumer => emailConsumer.Consume());

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
Exemple #2
0
        public TimerService(IBackgroundWorkerService backgroundWorkerService)
        {
            _backgroundWorkerService = backgroundWorkerService;

            _callbacks       = new List <DelayedCallback>();
            _timer           = new Timer();
            _timer.AutoReset = false;
            _timer.Elapsed  += TimerElapsed;
        }
Exemple #3
0
 public CreateTodoCommandHandler(
     IApplicationDbContext context,
     IBackgroundWorkerService backgroundWorkerService,
     IQueueService queueService)
 {
     _context = context;
     _backgroundWorkerService = backgroundWorkerService;
     _queueService            = queueService;
 }
 public FleetController(IPlayerService playerService, IBuildingsService buildingsService, IFleetService fleetService, ITechnologiesService techService, ILogicProvider logic, IBackgroundWorkerService<IFleetService> worker)
 {
     this.playerService = playerService;
     this.buildingsService = buildingsService;
     this.fleetService = fleetService;
     this.techService = techService;
     this.logic = logic;
     this.worker = worker;
 }
Exemple #5
0
        public GameStatsViewModel(IBackgroundWorkerService backgroundWorkerService)
        {
            _backgroundWorkerService = backgroundWorkerService;

            Progress = new ProgressFieldViewModel {
                Label = String.Empty
            };
            DialogTitle = "Game Stats";
            CanClose    = true;

            SearchCommand = new DelegateCommand(Search);
        }
        public GameStatsViewModel(IBackgroundWorkerService backgroundWorkerService, IFileSystemService fileSystem, ISettings settings)
        {
            _backgroundWorkerService = backgroundWorkerService;
            _fileSystem = fileSystem;
            _settings   = settings;

            Progress = new ProgressFieldViewModel {
                Label = String.Empty
            };
            DialogTitle = "Game Stats";
            CanClose    = true;

            SearchCommand            = new DelegateCommand(Search);
            ShowUserUnlocksCommand   = new DelegateCommand <UserStats>(ShowUserUnlocks);
            ShowUnlockHistoryCommand = new DelegateCommand <UserStats>(ShowUnlockHistory);
        }
Exemple #7
0
        public OpenTicketsViewModel(IFileSystemService fileSystemService, IHttpRequestService httpRequestService, IBackgroundWorkerService backgroundWorkerService)
        {
            _fileSystemService       = fileSystemService;
            _httpRequestService      = httpRequestService;
            _backgroundWorkerService = backgroundWorkerService;

            DialogTitle = "Open Tickets";
            CanClose    = true;

            OpenGameCommand        = new DelegateCommand <GameTickets>(OpenGame);
            OpenGameTicketsCommand = new DelegateCommand <GameTickets>(OpenGameTickets);
            OpenAchievementCommand = new DelegateCommand <AchievementTickets>(OpenAchievement);

            Progress = new ProgressFieldViewModel {
                Label = String.Empty
            };
            backgroundWorkerService.RunAsync(LoadTickets);
        }
Exemple #8
0
        public MasteryViewModel(IBackgroundWorkerService backgroundWorkerService, ISettings settings)
        {
            _backgroundWorkerService = backgroundWorkerService;
            _settings = settings;

            Progress = new ProgressFieldViewModel {
                Label = String.Empty
            };
            DialogTitle = "Mastery Analyzer";
            CanClose    = true;

            Snapshot = new GameDataSnapshotViewModel(Progress, backgroundWorkerService, settings);
            Snapshot.DataRefreshed += Snapshot_DataRefreshed;

            Results = new ObservableCollection <MasteryStats>();

            RefreshCommand   = new DelegateCommand(RefreshGames);
            ExportCommand    = new DelegateCommand(Export);
            SummarizeCommand = new DelegateCommand(Summarize);

            OpenGameCommand = new DelegateCommand <Result>(OpenGame);

            AddPropertyChangedHandler(DialogResultProperty, OnDialogResultPropertyChanged);
        }
Exemple #9
0
        public GameDataSnapshotViewModel(ProgressFieldViewModel progress, IBackgroundWorkerService backgroundWorkerService, ISettings settings)
        {
            _progress = progress;
            _backgroundWorkerService = backgroundWorkerService;
            _settings = settings;

            if (String.IsNullOrEmpty(settings.DoRequestToken))
            {
                RefreshCommand = DisabledCommand.Instance;
            }
            else
            {
                RefreshCommand = new DelegateCommand(DoRefresh);
            }

            _gamesWithAchievements = new List <int>();
            _gamesWithLeaderboards = new List <int>();
            _gamesWithRichPresence = new List <int>();

            if (_progress != null)
            {
                _backgroundWorkerService.RunAsync(LoadFromDisk);
            }
        }
Exemple #10
0
        public ConditionsAnalyzerViewModel(IBackgroundWorkerService backgroundWorkerService, ISettings settings)
        {
            _backgroundWorkerService = backgroundWorkerService;
            _settings = settings;

            Progress = new ProgressFieldViewModel {
                Label = String.Empty
            };
            DialogTitle = "Conditions Analyzer";
            CanClose    = true;

            Snapshot = new GameDataSnapshotViewModel(Progress, backgroundWorkerService, settings);

            NumConditions = new RangeFilterFieldViewModel("Number of Conditions");
            NumAltGroups  = new RangeFilterFieldViewModel("Number of Alt Groups");

            var flagLookup = new[]
            {
                new LookupItem(-1, "Any"),
                new LookupItem((int)RequirementType.None, "None"),
                new LookupItem((int)RequirementType.ResetIf, "ResetIf"),
                new LookupItem((int)RequirementType.PauseIf, "PauseIf"),
                new LookupItem((int)RequirementType.AddHits, "AddHits"),
                new LookupItem((int)RequirementType.SubHits, "SubHits"),
                new LookupItem((int)RequirementType.AddSource, "AddSource"),
                new LookupItem((int)RequirementType.SubSource, "SubSource"),
                new LookupItem((int)RequirementType.AddAddress, "AddAddress"),
                new LookupItem((int)RequirementType.ResetNextIf, "ResetNextIf"),
                new LookupItem((int)RequirementType.Trigger, "Trigger"),
                new LookupItem((int)RequirementType.AndNext, "AndNext"),
                new LookupItem((int)RequirementType.OrNext, "OrNext"),
                new LookupItem((int)RequirementType.Measured, "Measured"),
                new LookupItem((int)RequirementType.MeasuredPercent, "MeasuredPercent"),
                new LookupItem((int)RequirementType.MeasuredIf, "AddHits"),
            };

            var typeLookup = new[]
            {
                new LookupItem(-1, "Any"),
                new LookupItem((int)FieldType.MemoryAddress, "Mem"),
                new LookupItem((int)FieldType.PreviousValue, "Delta"),
                new LookupItem((int)FieldType.PriorValue, "Prior"),
                new LookupItem((int)FieldType.Value, "Value"),
            };

            var comparisonLookup = new[]
            {
                new LookupItem(-1, "Any"),
                new LookupItem((int)RequirementOperator.Equal, "=="),
                new LookupItem((int)RequirementOperator.NotEqual, "!="),
                new LookupItem((int)RequirementOperator.LessThan, "<"),
                new LookupItem((int)RequirementOperator.LessThanOrEqual, "<="),
                new LookupItem((int)RequirementOperator.GreaterThan, ">"),
                new LookupItem((int)RequirementOperator.GreaterThanOrEqual, ">="),
                new LookupItem((int)RequirementOperator.Multiply, "*"),
                new LookupItem((int)RequirementOperator.Divide, "/"),
                new LookupItem((int)RequirementOperator.BitwiseAnd, "&"),
            };

            Flag = new LookupFieldViewModel("Flag", flagLookup)
            {
                SelectedId = -1
            };
            SourceType = new LookupFieldViewModel("Source Type", typeLookup)
            {
                SelectedId = -1
            };
            SourceValue = new RangeFilterFieldViewModel("Source Value");
            Comparison  = new LookupFieldViewModel("Comparison", comparisonLookup)
            {
                SelectedId = -1
            };
            TargetType = new LookupFieldViewModel("Target Type", typeLookup)
            {
                SelectedId = -1
            };
            TargetValue = new RangeFilterFieldViewModel("Target Value");
            HitCount    = new RangeFilterFieldViewModel("Hit Count");

            Results         = new ObservableCollection <Result>();
            SearchCommand   = new DelegateCommand(Search);
            ExportCommand   = new DelegateCommand(Export);
            OpenGameCommand = new DelegateCommand <Result>(OpenGame);
            OpenItemCommand = new DelegateCommand <Result>(OpenItem);

            AddPropertyChangedHandler(DialogResultProperty, OnDialogResultPropertyChanged);
        }
Exemple #11
0
 public HttpListener(IBackgroundWorkerService backgroundWorkerService)
 {
     _backgroundWorkerService = backgroundWorkerService;
     _listener = new System.Net.HttpListener();
     _handlers = new List <HttpHandler>();
 }