Beispiel #1
0
        public SettingsViewModel(IUILanguageProvider uiLanguageProvider,
                                 SidekickSettings sidekickSettings,
                                 INativeKeyboard nativeKeyboard,
                                 ILeagueService leagueService)
        {
            this.uiLanguageProvider = uiLanguageProvider;
            this.sidekickSettings   = sidekickSettings;
            this.nativeKeyboard     = nativeKeyboard;

            Settings = new SidekickSettings();
            AssignValues(sidekickSettings, Settings);

            Keybinds.Clear();
            Settings.GetType()
            .GetProperties()
            .Where(x => x.Name.StartsWith("Key"))
            .ToList()
            .ForEach(x => Keybinds.Add(x.Name, x.GetValue(Settings).ToString()));

            WikiOptions.Add("POE Wiki", WikiSetting.PoeWiki.ToString());
            WikiOptions.Add("POE Db", WikiSetting.PoeDb.ToString());

            leagueService.Leagues.ForEach(x => LeagueOptions.Add(x.Id, x.Text));
            uiLanguageProvider.AvailableLanguages.ForEach(x => UILanguageOptions.Add(x.NativeName.First().ToString().ToUpper() + x.NativeName.Substring(1), x.Name));

            nativeKeyboard.OnKeyDown += NativeKeyboard_OnKeyDown;
        }
Beispiel #2
0
 public LeagueApi(ILogger <LeagueApi> logger, ApplicationDbContext dbContext, ILeagueService leagueService, IConfiguration configuration)
     : base(logger)
 {
     this.dbContext     = dbContext;
     this.leagueService = leagueService;
     adminKey           = configuration["AdminKey"];
 }
Beispiel #3
0
 public RefereeFormViewModel(IRegionManager regionManager, IViewToDataService viewToDataService, ILeagueService leagueService)
 {
     this.regionManager     = regionManager;
     this.leagueService     = leagueService;
     this.viewToDataService = viewToDataService;
     this.Referee           = new Referee();
 }
Beispiel #4
0
 public TeamToSeasonFormViewModel(IRegionManager regionManager, IInteractionService interactionService, ILeagueService leagueService)
 {
     this.regionManager      = regionManager;
     this.interactionService = interactionService;
     this.leagueService      = leagueService;
     this.OKCommand          = new DelegateCommand(async() =>
     {
         if (this.SelectedItem != null)
         {
             this.IsEnabled = GlobalCommands.BlockWindowButtons();
             var result     = this.leagueService.AssignTeamToSeason(SelectedItem.Id, this.seasonId);
             if (!(await result))
             {
                 await this.interactionService.ShowMessageBox("Team already added", "This team was already assigned to this season.");
                 this.IsEnabled = GlobalCommands.UnlockWindowButtons();
                 return;
             }
         }
         else
         {
             await this.interactionService.ShowMessageBox("No seasons available", "To assign team to season, add season first.");
         }
         GlobalCommands.GoBackCommand.Execute(null);
     });
 }
        public RebaseController(
            IChampionService championService,
            IItemService itemService,
            ILeagueService leagueService,
            IMasteryService masteryService,
            IMatchService matchService,
            IPlayerService playerService,
            ITeamService teamService,
            ITournamentService tournamentService,
            ISpellService spellService,
            ISerieService serieService,
            ILogger <RebaseController> logger)
        {
            _championService   = championService ?? throw new ArgumentNullException(nameof(championService));
            _itemService       = itemService ?? throw new ArgumentNullException(nameof(itemService));
            _leagueService     = leagueService ?? throw new ArgumentNullException(nameof(leagueService));
            _masteryService    = masteryService ?? throw new ArgumentNullException(nameof(masteryService));
            _matchService      = matchService ?? throw new ArgumentNullException(nameof(matchService));
            _playerService     = playerService ?? throw new ArgumentNullException(nameof(playerService));
            _serieService      = serieService ?? throw new ArgumentNullException(nameof(serieService));
            _spellService      = spellService ?? throw new ArgumentNullException(nameof(spellService));
            _teamService       = teamService ?? throw new ArgumentNullException(nameof(teamService));
            _tournamentService = tournamentService ?? throw new ArgumentNullException(nameof(tournamentService));

            _logger = logger ?? throw new ArgumentNullException(nameof(logger));

            pandaScoreAccessToken = Environment.GetEnvironmentVariable("PandaScoreAPIAccessToken");
        }
 public FixturesFormViewModel(IRegionManager regionManager, IInteractionService interactionService, ILeagueService leagueService)
 {
     this.regionManager      = regionManager;
     this.leagueService      = leagueService;
     this.interactionService = interactionService;
     this.OKCommand          = new DelegateCommand(async() =>
     {
         this.IsEnabled = GlobalCommands.BlockWindowButtons();
         var result     = await this.leagueService.GenerateFixtures(this.SelectedItem.Id, this.StartingDate, this.IntervalValue);
         if (!result)
         {
             this.IsEnabled = GlobalCommands.UnlockWindowButtons();
             await this.interactionService.ShowConfirmationMessage("Fixture already exists", "Fixture can't be generated, because it already exists. Do you want to override?", async() =>
             {
                 this.IsEnabled = GlobalCommands.BlockWindowButtons();
                 await this.leagueService.GenerateFixtures(this.SelectedItem.Id, this.StartingDate, this.IntervalValue, true);
                 regionManager.RequestNavigate(UiRegions.MainRegion, nameof(MainMenu));
             });
         }
         else
         {
             regionManager.RequestNavigate(UiRegions.MainRegion, nameof(MainMenu));
         }
     });
 }
 public SeasonFormViewModel(IRegionManager regionManager, IViewToDataService viewToDataService, ILeagueService leagueService)
 {
     this.regionManager     = regionManager;
     this.leagueService     = leagueService;
     this.viewToDataService = viewToDataService;
     this.Season            = new Season();
 }
Beispiel #8
0
 public MatchController(IMatchService matchService,
                        IRoundService roundService,
                        ILeagueService leagueService)
 {
     this.matchService  = matchService;
     this.roundService  = roundService;
     this.leagueService = leagueService;
 }
 public LeagueController(ILeagueService leagueService, IUserService userService, IMailService mailService, IGameService gameService,
                         IPlayerService playerService)
     : base(userService, mailService)
 {
     _leagueService = leagueService;
     _gameService   = gameService;
     _playerService = playerService;
 }
Beispiel #10
0
        public LeaguePresenter(ILeaguesView view, ILeagueService leagueService)
            : base(view)
        {
            Guard.WhenArgument(leagueService, "leagueService").IsNull().Throw();
            this.leagueService = leagueService;

            this.View.OnGetLeagues += View_GetLeagues;
        }
Beispiel #11
0
        public LeaguesController(ILeagueService leagueService, ICompetitionService competitionService)
        {
            Check.Require(leagueService != null, "leagueService may not be null");
            Check.Require(competitionService != null, "competitionService may not be null");

            this.leagueService      = leagueService;
            this.competitionService = competitionService;
        }
Beispiel #12
0
        public LeagueUnitTests()
        {
            LeagueService     = new Dartball.BusinessLayer.League.Implementation.LeagueService();
            TEST_ALTERNATE_ID = Guid.NewGuid();

            Dartball.Data.DartballContext dartballContext = new Dartball.Data.DartballContext();
            dartballContext.Migrate();
        }
        public LeaguesController(ILeagueService leagueService, ICompetitionService competitionService)
        {
            Check.Require(leagueService != null, "leagueService may not be null");
            Check.Require(competitionService != null, "competitionService may not be null");

            this.leagueService = leagueService;
            this.competitionService = competitionService;
        }
 public MatchService(FMDbContext context, ITeamService teamService,
                     ILeagueService leagueService, IMatchHandler matchHandler)
 {
     this.context       = context ?? throw new ArgumentNullException(nameof(context));
     this.teamService   = teamService;
     this.leagueService = leagueService;
     this.matchHandler  = matchHandler;
 }
        public LeagueServiceTests()
        {
            m_kernel = new StandardKernel();
            m_kernel.Load(Assembly.GetExecutingAssembly());

            m_leagues = m_kernel.Get<ILeagueService>();
            m_leagues.ApiKey = Settings1.Default.ApiKey;
        }
Beispiel #16
0
 public MatchAdminController(IMatchAdminService matchAdminService,
                             IMatchService matchService,
                             ILeagueService leagueService)
 {
     this.matchAdminService = matchAdminService;
     this.matchService      = matchService;
     this.leagueService     = leagueService;
 }
Beispiel #17
0
        public void SetUp()
        {
            leagueService = Substitute.For <ILeagueService>();
            dbContext     = DbContextUtility.CreateMockDb();
            var logger        = Substitute.For <ILogger <LeagueApi> >();
            var configuration = Substitute.For <IConfiguration>();

            testObj = new LeagueApi(logger, dbContext, leagueService, configuration);
        }
 public MatchFormViewModel(IRegionManager regionManager, ILeagueService leagueService)
 {
     this.regionManager = regionManager;
     this.leagueService = leagueService;
     this.Match         = new Match()
     {
         Date = DateTime.Today
     };
 }
Beispiel #19
0
 public PredictController(
     IGameWeekService gameWeekService,
     IPredictionService predictionService,
     ILeagueService leagueService)
 {
     this.gameWeekService   = gameWeekService;
     this.predictionService = predictionService;
     this.leagueService     = leagueService;
 }
        public LeagueServiceTests()
        {
            var configuration = new MapperConfiguration(cfg
                                                        => cfg.AddProfile <AutoMapperLeagueProfile>());

            _mapper         = new Mapper(configuration);
            _repositoryMock = new Mock <ILeagueRepository>();
            _service        = new LeagueService(_repositoryMock.Object, _mapper);
        }
Beispiel #21
0
 public StadiumFormViewModel(IRegionManager regionManager, ILeagueService leagueService)
 {
     this.regionManager = regionManager;
     this.leagueService = leagueService;
     this.Stadium       = new Stadium()
     {
         Address = new Address()
     };
 }
        public AnalyzeSummonerMatchHistoryWorker(IAnalyzeSummonerMatchHistoryQueue queue, ILeagueService leagueService, ICommandExecutor commandExecutor)
        {
            Guard.NotNull(queue, nameof(queue));
            Guard.NotNull(leagueService, nameof(leagueService));
            Guard.NotNull(commandExecutor, nameof(commandExecutor));

            this._queue = queue;
            this._leagueService = leagueService;
            this._commandExecutor = commandExecutor;
        }
Beispiel #23
0
 public LeaguesController(ILeagueService leagueService,
                          ITeamService teamService,
                          IGameService gameService,
                          ILogger <LeaguesController> logger)
 {
     _leagueService = leagueService;
     _teamService   = teamService;
     _gameService   = gameService;
     _logger        = logger;
 }
 public CoachFormViewModel(IRegionManager regionManager, ILeagueService leagueService)
 {
     this.regionManager = regionManager;
     this.leagueService = leagueService;
     this.Coach         = new Coach()
     {
         BirthDate = DateTime.Today
     };
     this.TeamLabel = "No team";
 }
 public PenaltiesController(IPenaltyService penaltyService,
                            ILeagueService leagueService,
                            ITeamService teamService,
                            IMatchResultService matchResultService)
 {
     this.penaltyService     = penaltyService;
     this.leagueService      = leagueService;
     this.teamService        = teamService;
     this.matchResultService = matchResultService;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWorkManager"> </param>
 /// <param name="membershipService"></param>
 /// <param name="localizationService"></param>
 /// <param name="roleService"></param>
 /// <param name="settingsService"> </param>
 /// <param name="loggingService"> </param>
 public ProbabilitiesController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, ILocalizationService localizationService,
                                IRoleService roleService, ISettingsService settingsService,
                                ITeamService teamService, ILeagueService leagueService, ISeasonService seasonService, IProbabilitiesService probabilitiesService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _teamService          = teamService;
     _leagueService        = leagueService;
     _seasonService        = seasonService;
     _probabilitiesService = probabilitiesService;
 }
Beispiel #27
0
 public MatchesController(IMatchService matchService,
                          ILeagueService leagueService, IRepository <Match> repository,
                          ITeamService teamService, IMapper mapper)
 {
     this.matchService    = matchService;
     this.teamService     = teamService;
     this.leagueService   = leagueService;
     this.mapper          = mapper;
     this.matchRepository = repository;
 }
 public PenaltiesController(IPenaltyService penaltyService,
     ILeagueService leagueService,
     ITeamService teamService,
     IMatchResultService matchResultService)
 {
     this.penaltyService = penaltyService;
     this.leagueService = leagueService;
     this.teamService = teamService;
     this.matchResultService = matchResultService;
 }
        public FixturesController(ILeagueService leagueService, ITeamService teamService, IFixtureService fixtureService)
        {
            Guard.WhenArgument(leagueService, "leagueService").IsNull().Throw();
            Guard.WhenArgument(teamService, "teamService").IsNull().Throw();
            Guard.WhenArgument(fixtureService, "fixtureService").IsNull().Throw();

            this.teamService    = teamService;
            this.leagueService  = leagueService;
            this.fixtureService = fixtureService;
        }
Beispiel #30
0
 public LeaguesController(
     ILeagueService leagueService,
     ISingleLeagueMatchService singleLeagueMatchService,
     IMapper mapper,
     IDoubleLeaugeMatchService doubleLeagueMatchService)
 {
     _leagueService            = leagueService;
     _singleLeagueMatchService = singleLeagueMatchService;
     _doubleLeagueMatchService = doubleLeagueMatchService;
     _mapper = mapper;
 }
        public LeagueWinnersController(ILeagueWinnerService leagueWinnerService,
            ILeagueService leagueService,
            ITeamService teamService)
        {
            Check.Require(leagueWinnerService != null, "leagueWinnerService may not be null");
            Check.Require(leagueService != null, "leagueService may not be null");
            Check.Require(teamService != null, "teamService may not be null");

            this.leagueWinnerService = leagueWinnerService;
            this.leagueService = leagueService;
            this.teamService = teamService;
        }
Beispiel #32
0
 public ServiceFacade(IGameService gameService, ITeamService teamService, IGameGoalieStatisticService gameGoalieStatisticService, IGameSkaterStatisticService gameSkaterStatisticService, IGamePlayedService gamePlayedService, IPlayerService playerService, IPenaltyService penaltyService, ILeagueService leagueService, ISeasonService seasonService)
 {
     _gameService = gameService;
     _teamService = teamService;
     _gameGoalieStatisticService = gameGoalieStatisticService;
     _gameSkaterStatisticService = gameSkaterStatisticService;
     _gamePlayedService          = gamePlayedService;
     _playerService  = playerService;
     _penaltyService = penaltyService;
     _seasonService  = seasonService;
     _leagueService  = leagueService;
 }
Beispiel #33
0
        public LeagueWinnersController(ILeagueWinnerService leagueWinnerService,
                                       ILeagueService leagueService,
                                       ITeamService teamService)
        {
            Check.Require(leagueWinnerService != null, "leagueWinnerService may not be null");
            Check.Require(leagueService != null, "leagueService may not be null");
            Check.Require(teamService != null, "teamService may not be null");

            this.leagueWinnerService = leagueWinnerService;
            this.leagueService       = leagueService;
            this.teamService         = teamService;
        }
        public ScoresPresenter(IScoresView view, IGameService gameService, ILeagueService leagueService)
            : base(view)
        {
            Guard.WhenArgument(gameService, "gameService").IsNull().Throw();
            Guard.WhenArgument(leagueService, "leagueService").IsNull().Throw();

            this.gameService   = gameService;
            this.leagueService = leagueService;

            this.View.OnGetLeagues      += View_OnGetLeagues;
            this.View.OnGetGameByLeague += View_OnGetGameByLeague;
            this.View.OnGetGameById     += View_OnGetGameById;
        }
Beispiel #35
0
 public GroupMeRequestRequestService(IMflTranslationService mflTranslationService, IDataSetHelperService dataHelper, IGroupMeApi gmApi, IMflApi mfl, IGlobalMflApi globalMflApi, ILeagueService leagueService, IRumorService rumor, IInsultApi insult)
 {
     _mflTranslationService = mflTranslationService;
     _dataHelper            = dataHelper;
     _gmApi         = gmApi;
     _mfl           = mfl;
     _globalMflApi  = globalMflApi;
     _leagueService = leagueService;
     _rumor         = rumor;
     _insult        = insult;
     _owners        = Utils.owners;
     _memberIds     = Utils.memberIds;
     _thisYear      = Utils.ThisYear;
 }
 public LeagueController(ILeagueService leagueService)
 {
     Check.Require(leagueService != null, "leagueService may not be null");
         this.leagueService = leagueService;
 }