コード例 #1
0
 public HomeController(ILogger <HomeController> logger, IWebsiteAnalyzer websiteAnalyzer,
                       IWebsiteService websiteService)
 {
     _logger          = logger;
     _websiteAnalyzer = websiteAnalyzer;
     _websiteService  = websiteService;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WebsiteController" /> class.
 /// </summary>
 /// <param name="loggerService">The logger service.</param>
 /// <param name="websiteService">The website service.</param>
 public WebsiteController(
     ILoggerService loggerService,
     IWebsiteService websiteService)
     : base(loggerService)
 {
     this.websiteService = websiteService;
 }
コード例 #3
0
        public MatchesBase(IInternalService internalService, IWebsiteService website, IMatchesTabService matchesTab, GameMode matchGameMode, MatchesTab currentTab)
            : base(internalService)
        {
            Website           = website;
            MatchesTabService = matchesTab;
            MatchGameMode     = matchGameMode;
            CurrentTab        = currentTab;

            ShowMatchSummaryButtonEnabled = true;

            SeasonList.Add("Lifetime");
            SeasonList.AddRange(HeroesHelpers.Seasons.GetSeasonList());
            SelectedSeasonOption = SeasonList[0];

            GameTimeList           = HeroesHelpers.GameDates.GameTimeList;
            SelectedGameTimeOption = GameTimeList[0];

            GameDateList           = HeroesHelpers.GameDates.GameDateList;
            SelectedGameDateOption = GameDateList[0];

            MapsList.Add("Any");
            MapsList.AddRange(HeroesIcons.MapBackgrounds().GetMapsList());
            SelectedMapOption = MapsList[0];

            ReplayBuildsList.Add("Any");
            ReplayBuildsList.AddRange(HeroesHelpers.Builds.GetBuildsList(HeroesIcons));
            SelectedBuildOption = ReplayBuildsList[0];

            HeroesList.Add("Any");
            HeroesList.AddRange(HeroesIcons.Heroes().GetListOfHeroes(HeroesIcons.GetLatestHeroesBuild()));
            SelectedCharacter = HeroesList[0];

            Messenger.Default.Register <MatchesDataMessage>(this, (message) => ReceivedMatchSearchData(message));
            Messenger.Default.Register <NotificationMessage>(this, async(message) => await ReceivedMessageAsync(message));
        }
コード例 #4
0
 public InternalService(IDatabaseService database, IHeroesIconsService heroesIcons, ISelectedUserProfileService userProfile, IWebsiteService website)
 {
     Database    = database;
     HeroesIcons = heroesIcons;
     UserProfile = userProfile;
     Website     = website;
 }
コード例 #5
0
 public HomeController(ILogger <HomeController> logger, IScraperService scraperService, ISearchTermService searchTermService, ISearchEngineService searchEngineService, IWebsiteService website)
 {
     _logger              = logger;
     _scraperService      = scraperService;
     _searchTermService   = searchTermService;
     _searchEngineService = searchEngineService;
     _website             = website;
 }
コード例 #6
0
 public MatchPlayerBase(IInternalService internalService, IWebsiteService website, ReplayMatchPlayer player)
 {
     Database    = internalService.Database;
     HeroesIcons = internalService.HeroesIcons;
     UserProfile = internalService.UserProfile;
     Website     = website;
     Player      = player;
 }
コード例 #7
0
 public WebPageController(IWebsiteService websiteService, IWebPageService webPageService, ISectionService sectionService, IWorkContext workContext, IWebHelper webHelper, ILogger <WebPageController> logger)
 {
     _websiteService = websiteService;
     _webPageService = webPageService;
     _sectionService = sectionService;
     _workContext    = workContext;
     _webHelper      = webHelper;
     _logger         = logger;
 }
コード例 #8
0
 public PagesScrapperService(IHtmlScrapper htmlScrapper,
                             IWebsiteService websiteService,
                             IWebsitesRepository websiteRepository, IMapper mapper)
 {
     _htmlScrapper      = htmlScrapper;
     _websiteService    = websiteService;
     _websiteRepository = websiteRepository;
     _mapper            = mapper;
 }
コード例 #9
0
 public TrackingController(IAppUserSessionService appUserSessionService, IUserWebsiteService userWebsiteService, IWebsiteService websiteService, ITrackingRecordService trackingRecordService, IGenericService <PricePosition> pricePositionService, IHtmlLoaderService htmlLoaderService)
 {
     this.appUserSessionService = appUserSessionService;
     this.userWebsiteService    = userWebsiteService;
     this.websiteService        = websiteService;
     this.trackingRecordService = trackingRecordService;
     this.pricePositionService  = pricePositionService;
     this.htmlLoaderService     = htmlLoaderService;
 }
コード例 #10
0
        public void AddAsync_IsWebsiteNameUnique_ReturnsNotUniqueException()
        {
            using var context = new DataContext(options);
            var mc = new MemoryCache(new MemoryCacheOptions());
            var categoryService = new CategoryService(context, mc);

            websiteService = new WebsiteService(context, categoryService, new UserService(new PasswordService()));

            Assert.CatchAsync(typeof(NotUniqueException), async() => await websiteService.AddAsync(websiteAddModel), "Should return ArgumentNullException.");
        }
コード例 #11
0
 public HomeController(IServiceProvider serviceProvider) : base(serviceProvider)
 {
     _userService          = serviceProvider.GetService <IUserService>();
     _userSessionService   = serviceProvider.GetService <IUserSessionService>();
     websiteService        = serviceProvider.GetService <IWebsiteService>();
     languageService       = serviceProvider.GetService <ILanguageService>();
     languageCookieService = serviceProvider.GetService <ILanguageCookieService>();
     emailService          = serviceProvider.GetService <IEmailService>();
     uI_NoticeService      = serviceProvider.GetService <IUI_NoticeService>();
 }
コード例 #12
0
        public void DeleteAsync_ThrowsNotFoundException()
        {
            using var context = new DataContext(options);
            var mc = new MemoryCache(new MemoryCacheOptions());
            var categoryService = new CategoryService(context, mc);

            websiteService = new WebsiteService(context, categoryService, new UserService(new PasswordService()));

            Assert.CatchAsync(typeof(NotFoundException), async() => await websiteService.DeleteAsync(Guid.Parse("4e7a04d2-b0a1-4dbd-9b4e-8b326c272565")), "Should return NotFoundException.");
        }
コード例 #13
0
        public void DeleteAsync_ThrowsArgumentNullException()
        {
            using var context = new DataContext(options);
            var mc = new MemoryCache(new MemoryCacheOptions());
            var categoryService = new CategoryService(context, mc);

            websiteService = new WebsiteService(context, categoryService, new UserService(new PasswordService()));

            Assert.CatchAsync(typeof(ArgumentNullException), async() => await websiteService.DeleteAsync(Guid.Empty), "Should return ArgumentNullException.");
        }
コード例 #14
0
        public MatchHistoryMatch(IInternalService internalService, IWebsiteService website, ReplayMatch replayMatch)
        {
            InternalService = internalService;
            HeroesIcons     = internalService.HeroesIcons;
            UserProfile     = internalService.UserProfile;
            Website         = website;

            ReplayMatch = replayMatch;

            SetMatch();
        }
コード例 #15
0
 public ExternalSiteContentController(
     IReadOnlyPolicyRegistry <string> policyRegistry,
     IWebsiteService websiteService,
     ISentimentAnalysisService sentimentAnalysisService,
     ILogger <ExternalSiteContentController> logger)
 {
     _policy                   = policyRegistry.Get <IAsyncPolicy <AnalysisResponse> >(Policies.AnalysisResponsePolicy);
     _websiteService           = websiteService;
     _sentimentAnalysisService = sentimentAnalysisService;
     _logger                   = logger;
 }
コード例 #16
0
        public MatchPlayerBase(IInternalService internalService, IWebsiteService website, ReplayMatchPlayer player)
        {
            Database    = internalService.Database;
            HeroesIcons = internalService.HeroesIcons;
            UserProfile = internalService.UserProfile;
            Website     = website;
            Player      = player;

            SilenceIcon = HeroesIcons.GetOtherIcon(OtherIcon.Silence);
            TalentBorderScoreScreenIcon = HeroesIcons.GetOtherIcon(OtherIcon.TalentAvailable);
        }
コード例 #17
0
 public GlobalController(IServiceProvider serviceProvider)
 {
     websiteService        = serviceProvider.GetService <IWebsiteService>();
     languageService       = serviceProvider.GetService <ILanguageService>();
     languageCookieService = serviceProvider.GetService <ILanguageCookieService>();
     httpContextAccessor   = serviceProvider.GetService <IHttpContextAccessor>();
     websiteCookieService  = serviceProvider.GetService <IWebsiteCookieService>();
     cacheService          = serviceProvider.GetService <ICacheService>();
     defaultLanguage       = serviceProvider.GetService <IOptions <Language> >().Value;
     LoadWebsite();
 }
コード例 #18
0
 public LoginViewModel(IConnectionService connectionService, ISettingsService settingsService,
     INavigationService navigationService,
     IAuthenticationService authenticationService,
     IDialogService dialogService,
     IWebsiteService websiteService)
     : base(connectionService, navigationService, dialogService)
 {
     _authenticationService = authenticationService;
     _settingsService = settingsService;
     _websiteService = websiteService;
     _mobileNo = settingsService.UserMobileSetting ?? string.Empty;
 }
コード例 #19
0
 public GlobalController(IServiceProvider serviceProvider)
 {
     websiteService        = serviceProvider.GetService <IWebsiteService>();
     languageService       = serviceProvider.GetService <ILanguageService>();
     languageCookieService = serviceProvider.GetService <ILanguageCookieService>();
     httpContextAccessor   = serviceProvider.GetService <IHttpContextAccessor>();
     websiteCookieService  = serviceProvider.GetService <IWebsiteCookieService>();
     actionContextAccessor = serviceProvider.GetService <IActionContextAccessor>();
     webHostEnvironment    = serviceProvider.GetService <IWebHostEnvironment>();
     urlControlHelper      = serviceProvider.GetService <UrlControlHelper>();
     LoadWebsite();
 }
コード例 #20
0
        public async Task DeleteAsync_SetsTrue()
        {
            using var context = new DataContext(options);
            var mc = new MemoryCache(new MemoryCacheOptions());
            var categoryService = new CategoryService(context, mc);

            websiteService = new WebsiteService(context, categoryService, new UserService(new PasswordService()));
            await websiteService.DeleteAsync(websiteToDeleteId);

            bool isDeleted = (await context.Websites.IgnoreQueryFilters().Select(x => new { x.Id, x.IsDeleted }).FirstOrDefaultAsync(x => x.Id == websiteToDeleteId)).IsDeleted;

            Assert.IsTrue(isDeleted, "IsDeleted should be set to true.");
        }
コード例 #21
0
 public Seeder(
     IDataInitializer dataInitializer,
     IIdentityService identityService,
     IWebsiteService websiteService,
     IIdentityRepository identityRepository,
     IConfigurationRoot configuration)
 {
     _dataInitializer    = dataInitializer;
     _identityService    = identityService;
     _websiteService     = websiteService;
     _identityRepository = identityRepository;
     _configuration      = configuration;
 }
コード例 #22
0
        public async Task AddAsync_CreatesWebsite()
        {
            using var context = new DataContext(options);
            var mc = new MemoryCache(new MemoryCacheOptions());
            var categoryService = new CategoryService(context, mc);

            websiteService = new WebsiteService(context, categoryService, new UserService(new PasswordService()));

            websiteAddModel.Name = "A dd Async";
            Guid id = await websiteService.AddAsync(websiteAddModel);

            Assert.AreNotEqual(id, Guid.Empty, "Add async should return a GUID.");
        }
コード例 #23
0
 public PageController(
     IPageService pageService,
     IPageBackgroundService pageBackService,
     IWebsiteService websiteService,
     IWebsiteTextService websiteTextService,
     IMapper mapper)
 {
     _pageService        = pageService;
     _pageBackService    = pageBackService;
     _mapper             = mapper;
     _websiteService     = websiteService;
     _websiteTextService = websiteTextService;
 }
コード例 #24
0
        public HomeViewModel(IInternalService internalService, IWebsiteService website)
            : base(internalService)
        {
            Website = website;

            UserBattleTagUpdated = false;
            LatestReplayDateTime = DateTime.MinValue;

            Messenger.Default.Register <NotificationMessage>(this, (message) => ReceivedMessage(message));

            InitialMatchHistoryLoad();
            InitDynamicMatchLoading();
        }
コード例 #25
0
        public MatchPlayerBase(IInternalService internalService, IWebsiteService website, ReplayMatchPlayer player, int build)
        {
            Database    = internalService.Database;
            HeroesIcons = internalService.HeroesIcons;
            UserProfile = internalService.UserProfile;
            Website     = website;
            Player      = player;
            Build       = build;

            SilenceIcon                 = ImageStreams.OtherIconImage(OtherIcon.Silence);
            VoiceSilenceIcon            = ImageStreams.OtherIconImage(OtherIcon.VoiceSilence);
            TalentBorderScoreScreenIcon = ImageStreams.OtherIconImage(OtherIcon.TalentAvailable);
            BoostIcon = ImageStreams.OtherIconImage(OtherIcon.Boost);
        }
コード例 #26
0
        public static void UpdatePage(this IWebsiteService websiteService, string path, Action <Page> update)
        {
            if (websiteService == null)
            {
                throw new ArgumentNullException("websiteService");
            }
            if (update == null)
            {
                throw new ArgumentNullException("update");
            }

            using (var writer = websiteService.CreateWriter())
            {
                update(writer.Resource.FindPage(path));
            }
        }
コード例 #27
0
        public MatchSummaryViewModel(IInternalService internalService, IWebsiteService website, ILoadingOverlayWindowService loadingOverlayWindow)
            : base(internalService)
        {
            Website = website;
            LoadingOverlayWindow = loadingOverlayWindow;

            IsFlyoutLoadingOverlayVisible = false;
            IsLeftChangeButtonVisible     = true;
            IsRightChangeButtonVisible    = true;
            IsLeftChangeButtonEnabled     = false;
            IsRightChangeButtonEnabled    = false;

            ScoreKillIcon                   = ImageStreams.OtherIconImage(OtherIcon.Kills);
            ScoreAssistIcon                 = ImageStreams.OtherIconImage(OtherIcon.Assist);
            ScoreDeathIcon                  = ImageStreams.OtherIconImage(OtherIcon.Death);
            ScoreSiegeDamageIcon            = ImageStreams.OtherIconImage(OtherIcon.SiegeDamage);
            ScoreHeroDamageIcon             = ImageStreams.OtherIconImage(OtherIcon.HeroDamage);
            ScoreHealingAbsorbedIcon        = ImageStreams.OtherIconImage(OtherIcon.HealAbsorbedDamage);
            ScoreSelfHealingIcon            = ImageStreams.OtherIconImage(OtherIcon.SelfHealing);
            ScoreDamageTakenIcon            = ImageStreams.OtherIconImage(OtherIcon.DamageTaken);
            ScoreExperienceContributionIcon = ImageStreams.OtherIconImage(OtherIcon.ExperienceContribution);
            BlueKillsIcons                  = ImageStreams.OtherIconImage(OtherIcon.KillsBlue);
            RedKillsIcons                   = ImageStreams.OtherIconImage(OtherIcon.KillsRed);

            LeftArrowDisabledIcon  = ImageStreams.OtherIconImage(OtherIcon.LongarrowLeftDisabled);
            LeftArrowDownIcon      = ImageStreams.OtherIconImage(OtherIcon.LongarrowLeftDown);
            LeftArrowHoverIcon     = ImageStreams.OtherIconImage(OtherIcon.LongarrowLeftHover);
            LeftArrowNormalIcon    = ImageStreams.OtherIconImage(OtherIcon.LongarrowLeftNormal);
            RightArrowDisabledIcon = ImageStreams.OtherIconImage(OtherIcon.LongarrowRightDisabled);
            RightArrowDownIcon     = ImageStreams.OtherIconImage(OtherIcon.LongarrowRightDown);
            RightArrowHoverIcon    = ImageStreams.OtherIconImage(OtherIcon.LongarrowRightHover);
            RightArrowNormalIcon   = ImageStreams.OtherIconImage(OtherIcon.LongarrowRightNormal);

            HasBans      = false;
            HasObservers = false;
            HasChat      = false;

            TeamLevelTimeGraph  = new TeamLevelTimeGraph();
            TeamExperienceGraph = new TeamExperienceGraph(Database);
            StatGraphs          = new StatGraphs(Database);

            Messenger.Default.Register <NotificationMessage>(this, (message) => ReceivedMessage(message));

            SimpleIoc.Default.Register <IMatchSummaryReplayService>(() => this);
        }
コード例 #28
0
        public void SetUp()
        {
            options = new DbContextOptionsBuilder <DataContext>()
                      .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString())
                      .Options;

            using var context = new DataContext(options);
            var mc = new MemoryCache(new MemoryCacheOptions());
            var categoryService = new CategoryService(context, mc);

            context.Categories.Add(new Category {
                Code = CategoryCode.Sport, Name = "Sport"
            });
            context.SaveChanges();
            websiteService = new WebsiteService(context, categoryService, new UserService(new PasswordService()));

            websiteToDeleteId = Task.Run(() => websiteService.AddAsync(websiteAddModel)).GetAwaiter().GetResult();
        }
コード例 #29
0
 public PageBackgroundService(
     IWebsiteService websiteService,
     IWebsiteTextService websiteTextService,
     IPageService pageService,
     IEmailService emailService,
     IUserService userService,
     IHtmlDifferenceService differenceService,
     IConfiguration config,
     IPageDifferenceService pageDifferenceService)
 {
     _websiteService        = websiteService;
     _pageService           = pageService;
     _emailService          = emailService;
     _userService           = userService;
     _differenceService     = differenceService;
     _config                = config;
     _websiteTextService    = websiteTextService;
     _pageDifferenceService = pageDifferenceService;
 }
コード例 #30
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WebsiteController" /> class.
 /// </summary>
 /// <param name="loggerService">The logger service.</param>
 /// <param name="websiteService">The website service.</param>
 /// <param name="displayNameService">The display name service.</param>
 /// <param name="testService">The test service.</param>
 /// <param name="suiteService">The suite service.</param>
 /// <param name="schedulerService">The Scheduler service.</param>
 /// <param name="sharedTestService">The shared test service.</param>
 /// <param name="dataBaseCategoriesService">The data base Categories service.</param>
 public WebsiteController(
     ILoggerService loggerService,
     IWebsiteService websiteService,
     IPagesService displayNameService,
     ITestService testService,
     ISuiteService suiteService,
     ISchedulerService schedulerService,
     ISharedTestService sharedTestService,
     IDataBaseCategoriesService dataBaseCategoriesService)
     : base(loggerService)
 {
     this.websiteService            = websiteService;
     this.displayNameService        = displayNameService;
     this.testService               = testService;
     this.suiteService              = suiteService;
     this.schedulerService          = schedulerService;
     this.sharedTestService         = sharedTestService;
     this.dataBaseCategoriesService = dataBaseCategoriesService;
 }
コード例 #31
0
 public BookmarksService(IDeletableRepository<Bookmark> bookmarks, ITagsService tagService, IWebsiteService websiteService)
 {
     this.bookmarks = bookmarks;
     this.tagService = tagService;
     this.websiteService = websiteService;
 }
コード例 #32
0
 public PageController(IWebsiteService websiteService)
 {
     this.websiteService = websiteService;
 }
コード例 #33
0
 public ContentController(IWebsiteService websiteService)
 {
     this.websiteService = websiteService;
 }
コード例 #34
0
 public WebsitesController(IWebsiteService websites)
 {
     this.websites = websites;
 }
コード例 #35
0
 public ConfigurationController(IWebsiteService websiteService, IResourceService<Authorizer, IReadOnlyAuthorizer> authService)
 {
     this.websiteService = websiteService;
     this.authService = authService;
 }