public void Initialize(InitializationEngine context) { _routingEventHandler = context.Locate.Advanced.GetInstance <RoutingEventHandler>(); _httpContextAccessor = context.Locate.Advanced.GetInstance <ServiceAccessor <HttpContextBase> >(); Global.RoutesRegistered += (o, e) => e.Routes.RegisterPartialRouter(ServiceLocator.Current.GetInstance <PropertyPartialRouter>()); GlobalConfiguration.Configuration.Filters.Add(new PropertyResolveFilter(_httpContextAccessor)); }
public CommerceTrackingService( ServiceAccessor <IContentRouteHelper> contentRouteHelperAccessor, IContextModeResolver contextModeResolver, IProductService productService, TrackingDataFactory trackingDataFactory, ITrackingService trackingService, IContentLoader contentLoader, LanguageService languageService, HttpContextBase httpContextBase, LanguageResolver languageResolver, ILineItemCalculator lineItemCalculator, IRequestTrackingDataService requestTrackingDataService, ReferenceConverter referenceConverter, IRelationRepository relationRepository, ICurrentMarket currentMarket) { _contentRouteHelperAccessor = contentRouteHelperAccessor; _contextModeResolver = contextModeResolver; _productService = productService; _trackingDataFactory = trackingDataFactory; _trackingService = trackingService; _contentLoader = contentLoader; _languageService = languageService; _httpContextBase = httpContextBase; _languageResolver = languageResolver; _lineItemCalculator = lineItemCalculator; _requestTrackingDataService = requestTrackingDataService; _referenceConverter = referenceConverter; _relationRepository = relationRepository; _currentMarket = currentMarket; }
/// <summary> /// Initializes a new instance of the <see cref="GlobalSettingsSearchProvider" /> class. /// </summary> /// <param name="localizationService">The localization service.</param> /// <param name="siteDefinitionResolver">The site definition resolver.</param> /// <param name="contentTypeRepository">The content type repository.</param> /// <param name="editUrlResolver">The edit URL resolver.</param> /// <param name="currentSiteDefinition">The current site definition.</param> /// <param name="languageResolver">The language resolver.</param> /// <param name="urlResolver">The URL resolver.</param> /// <param name="templateResolver">The template resolver.</param> /// <param name="uiDescriptorRegistry">The UI descriptor registry.</param> /// <param name="contentLoader">The content loader.</param> /// <param name="settingsService">The settings service.</param> public GlobalSettingsSearchProvider( LocalizationService localizationService, ISiteDefinitionResolver siteDefinitionResolver, IContentTypeRepository <ContentType> contentTypeRepository, EditUrlResolver editUrlResolver, ServiceAccessor <SiteDefinition> currentSiteDefinition, LanguageResolver languageResolver, UrlResolver urlResolver, TemplateResolver templateResolver, UIDescriptorRegistry uiDescriptorRegistry, IContentLoader contentLoader, ISettingsService settingsService) : base( localizationService: localizationService, siteDefinitionResolver: siteDefinitionResolver, contentTypeRepository: contentTypeRepository, editUrlResolver: editUrlResolver, currentSiteDefinition: currentSiteDefinition, languageResolver: languageResolver, urlResolver: urlResolver, templateResolver: templateResolver, uiDescriptorRegistry: uiDescriptorRegistry) { this.contentLoader = contentLoader; this.settingsService = settingsService; this.localizationService = localizationService; }
public RedisOutputCacheFilter(IDistributedCache htmlCache, ServiceAccessor <IContentRouteHelper> contentRouteHelperAccessor, IContentCacheKeyCreator contentCacheKeyCreator, Settings settings) { _htmlCache = htmlCache; _contentRouteHelperAccessor = contentRouteHelperAccessor; _contentCacheKeyCreator = contentCacheKeyCreator; _duration = settings.HttpCacheExpiration; }
public ContentRendererInterceptor(IContentRenderer defaultRenderer, IHtmlCache htmlCache, ServiceAccessor <IContentRouteHelper> contentRouteHelperAccessor, IRenderingContextResolver contextResolver) { _defaultRenderer = defaultRenderer; _htmlCache = htmlCache; _contentRouteHelperAccessor = contentRouteHelperAccessor; _contextResolver = contextResolver; }
//This only runs the first time the page is made, so when a user first logs in (due to page caching) protected override async void OnInitialize()// { base.OnInitialize(); currentUserName = AppDataAccessor.GetUsername(); BindableCollection <Season> downloadedSeasons = await DownloadAccessor.Instance.GetDownloadsModel(true); if (ServiceAccessor.ConnectedToInternet()) { SeasonsDropDown = await GetSortedSeasons(); } else { SeasonsDropDown = downloadedSeasons; } string savedSeasonId = AppDataAccessor.GetTeamContext().seasonID; if (savedSeasonId != null && SeasonsDropDown.Any()) { SelectedSeason = SeasonsDropDown.Where(u => u.seasonId == savedSeasonId).FirstOrDefault() ?? SeasonsDropDown[0]; } else { SelectedSeason = SeasonsDropDown.LastOrDefault(u => u.year >= DateTime.Now.Year) ?? SeasonsDropDown[0]; AppDataAccessor.SetTeamContext(SelectedSeason.seasonId, SelectedSeason.owningTeam.teamID); } if (!SeasonsDropDown.Any()) { //show message here if no seasons } }
public async void DownloadButtonClick() { List <Playlist> playlistsToBeDownloaded = new List <Playlist>(); foreach (PlaylistViewModel playVM in playlistsSelected) { if (playVM.PlaylistModel.clips.Count == 0) { ClipResponse response = await ServiceAccessor.GetPlaylistClipsAndHeaders(playVM.PlaylistModel.playlistId); playVM.PlaylistModel.clips = response.clips; playVM.PlaylistModel.displayColumns = response.DisplayColumns; } List <Clip> additionalClips = await ServiceAccessor.GetAdditionalPlaylistClips(playVM.PlaylistModel.playlistId, playVM.PlaylistModel.clips.Count); foreach (Clip c in additionalClips) { playVM.PlaylistModel.clips.Add(c); } playlistsToBeDownloaded.Add(playVM.PlaylistModel); } DownloadButton_Visibility = Visibility.Collapsed; Downloading_Visibility = Visibility.Visible; DownloadProgressText = "Preparing Download"; DownloadProgress = 0; DownloadAccessor.Instance.cts = new CancellationTokenSource(); DownloadAccessor.Instance.currentlyDownloadingPlaylists = playlistsToBeDownloaded; DownloadAccessor.Instance.progressCallback = new Progress <DownloadOperation>(ProgressCallback); DownloadAccessor.Instance.DownloadPlaylists(playlistsToBeDownloaded, Season.DeepCopy(Parameter.season)); }
public PropertyPartialRouter(ServiceAccessor <HttpContextBase> httpContextAccessor, PropertyResolver propertyResolver) { _httpContextAccessor = httpContextAccessor; _propertyResolver = propertyResolver; PropertyDefinitionRepository.PropertyDefinitionDeleted += ClearPropertyLookup; PropertyDefinitionRepository.PropertyDefinitionSaved += ClearPropertyLookup; }
public RedisOutputCacheFilterProvider(IDistributedCache htmlCache, ServiceAccessor <IContentRouteHelper> contentRouteHelperAccessor, IContentCacheKeyCreator contentCacheKeyCreator, Settings settings) { _htmlCache = htmlCache; _contentRouteHelperAccessor = contentRouteHelperAccessor; _contentCacheKeyCreator = contentCacheKeyCreator; _settings = settings; }
public ExtendedContentModelMapper(IUrlResolver urlResolver, IContentModelMapper defaultContentModelMapper, ServiceAccessor <HttpContextBase> httpContextAccessor, IContentVersionRepository versionRepository) { _urlResolver = urlResolver; _defaultContentModelMapper = defaultContentModelMapper; _httpContextAccessor = httpContextAccessor; _versionRepository = versionRepository; }
public CheckoutViewModelFactory( LocalizationService localizationService, PaymentMethodViewModelFactory paymentMethodViewModelFactory, IAddressBookService addressBookService, IContentLoader contentLoader, UrlResolver urlResolver, ServiceAccessor <HttpContextBase> httpContextAccessor, ShipmentViewModelFactory shipmentViewModelFactory, ICustomerService customerService, IOrganizationService organizationService, IBudgetService budgetService, ICustomerService customerContext) { _localizationService = localizationService; _paymentMethodViewModelFactory = paymentMethodViewModelFactory; _addressBookService = addressBookService; _contentLoader = contentLoader; _urlResolver = urlResolver; _httpContextAccessor = httpContextAccessor; _shipmentViewModelFactory = shipmentViewModelFactory; _customerService = customerService; _organizationService = organizationService; _budgetService = budgetService; _customerContext = customerContext; }
public CustomContentApiRoutingEventHandler( IContentRouteEvents routeEvents, ServiceAccessor <HttpContextBase> httpContextAccessor, ContentApiRouteService contentApiRouteService) : base(routeEvents, httpContextAccessor, contentApiRouteService) { }
public UserService(ServiceAccessor <IAuthenticationManager> authenticationManager, ServiceAccessor <ApplicationSignInManager <SiteUser> > signinManager, ServiceAccessor <ApplicationUserManager <SiteUser> > userManager, LocalizationService localizationService) { AuthenticationManager = authenticationManager; SignInManager = signinManager; _localizationService = localizationService; UserManager = userManager; }
public FakeSearchProvider(LocalizationService localizationService, ISiteDefinitionResolver siteDefinitionResolver, IContentTypeRepository <PageType> contentTypeRepository, EditUrlResolver editUrlResolver, ServiceAccessor <SiteDefinition> currentSiteDefinition, IContentLanguageAccessor languageResolver, UrlResolver urlResolver, ITemplateResolver templateResolver, UIDescriptorRegistry uiDescriptorRegistry, IContentLoader contentLoader) : base(localizationService, siteDefinitionResolver, contentTypeRepository, editUrlResolver, currentSiteDefinition, languageResolver, urlResolver, templateResolver, uiDescriptorRegistry) { _contentLoader = contentLoader; }
public async Task <BindableCollection <Season> > GetPopulatedSeasons(Team team) { SeasonsResponse response = await ServiceAccessor.GetPopulatedSeasons(team); if (response.status == SERVICE_RESPONSE.SUCCESS) { return(response.Seasons); } return(null); }
public YouTubeProvider( ServiceAccessor <HttpContextBase> httpContextBase, IdentityMappingService identityMappingService, YouTubeRepository youTubeRepository, ThumbnailManager thumbnailManager) { _httpContextBase = httpContextBase; _identityMappingService = identityMappingService; _youTubeRepository = youTubeRepository; _thumbnailManager = thumbnailManager; }
public CustomerService(ServiceAccessor <ApplicationSignInManager <SiteUser> > signinManager, ServiceAccessor <ApplicationUserManager <SiteUser> > userManager, IHttpContextAccessor httpContextAccessor, LocalizationService localizationService) { _customerContext = CustomerContext.Current; _httpContextAccessor = httpContextAccessor; _localizationService = localizationService; UserManager = userManager; SignInManager = signinManager; }
public YouTubeProvider( ServiceAccessor<HttpContextBase> httpContextBase, IdentityMappingService identityMappingService, YouTubeRepository youTubeRepository, ThumbnailManager thumbnailManager) { _httpContextBase = httpContextBase; _identityMappingService = identityMappingService; _youTubeRepository = youTubeRepository; _thumbnailManager = thumbnailManager; }
public CustomerService(ServiceAccessor <IAuthenticationManager> authenticationManager, ServiceAccessor <ApplicationSignInManager <SiteUser> > signinManager, ServiceAccessor <ApplicationUserManager <SiteUser> > userManager, LocalizationService localizationService) { _customerContext = CustomerContext.Current; AuthenticationManager = authenticationManager; SignInManager = signinManager; _localizationService = localizationService; UserManager = userManager; }
public RecommendationService( ServiceAccessor <IContentRouteHelper> contentRouteHelperAccessor, IContextModeResolver contextModeResolver, IProductService productService, TrackingDataFactory trackingDataFactory, ITrackingService trackingService) { _contentRouteHelperAccessor = contentRouteHelperAccessor; _contextModeResolver = contextModeResolver; _productService = productService; _trackingDataFactory = trackingDataFactory; _trackingService = trackingService; }
public InstallService(ServiceAccessor <IDataImporter> dataImporter, ILanguageBranchRepository languageBranchRepository, ISiteDefinitionRepository siteDefinitionRepository, ContentExportProcessor contentExportProcessor, IConnectionStringHandler connectionStringHandler) { _dataImporter = dataImporter; _languageBranchRepository = languageBranchRepository; _siteDefinitionRepository = siteDefinitionRepository; _contentExportProcessor = contentExportProcessor; _connectionStringHandler = connectionStringHandler; }
public MultiShipmentViewModelFactory( LocalizationService localizationService, IAddressBookService addressBookService, UrlResolver urlResolver, ServiceAccessor <HttpContextBase> httpContextAccessor, ShipmentViewModelFactory shipmentViewModelFactory) { _localizationService = localizationService; _addressBookService = addressBookService; _urlResolver = urlResolver; _httpContextAccessor = httpContextAccessor; _shipmentViewModelFactory = shipmentViewModelFactory; }
protected override void OnActivate()//called every page load { base.OnActivate(); if (currentUserName != AppDataAccessor.GetUsername()) { Groups = new BindableCollection <HubGroupViewModel>();//clears old page after logout OnInitialize(); } SettingsPane.GetForCurrentView().CommandsRequested += CharmsData.SettingCharmManager_HubCommandsRequested; ProgressRingVisibility = Visibility.Collapsed; ProgressRingIsActive = false; PageIsEnabled = true; LastViewedResponse response = AppDataAccessor.GetLastViewed(); if (response.ID != null && ServiceAccessor.ConnectedToInternet()) { Game LastViewedGame = new Game { gameId = response.ID, opponent = response.name, date = DateTime.Parse(response.timeStamp) }; //this is actually a playlist - not a game GameViewModel lastViewed = new GameViewModel(LastViewedGame, true, isLastviewed: true); lastViewed.Thumbnail = response.thumbnail; lastViewed.Stretch = "UniformToFill"; LastViewedVM = new HubGroupViewModel() { Name = "Last Viewed", Games = new BindableCollection <GameViewModel>() }; LastViewedVM.Games.Add(lastViewed); if (Groups.Count == 0 && (NoScheduleEntriesText == null || NoScheduleEntriesText == "")) { ProgressRingVisibility = Visibility.Visible; ProgressRingIsActive = true; } if (Groups.Count >= 3) { HubGroupViewModel oldLastViewed = Groups.Where(u => u.Name == "Last Viewed").FirstOrDefault(); if (oldLastViewed != null) { Groups[Groups.IndexOf(oldLastViewed)] = LastViewedVM; } else { Groups.Insert(1, LastViewedVM); } } } }
public MultiShipmentViewModelFactory( LocalizationService localizationService, IAddressBookService addressBookService, IContentLoader contentLoader, UrlResolver urlResolver, ServiceAccessor<HttpContextBase> httpContextAccessor, ShipmentViewModelFactory shipmentViewModelFactory) { _localizationService = localizationService; _addressBookService = addressBookService; _contentLoader = contentLoader; _urlResolver = urlResolver; _httpContextAccessor = httpContextAccessor; _shipmentViewModelFactory = shipmentViewModelFactory; }
public DefaultBlockTypeConverter( ServiceAccessor <ConvertBlockTypeDb> dbAccessor, IContentRepository contentRepository, IContentCacheRemover contentCacheRemover, IPropertyDefinitionRepository propertyDefinitionRepository, IContentTypeRepository contentTypeRepository, LocalizationService localizationService) { _dbAccessor = dbAccessor; _contentRepository = contentRepository; _contentCacheRemover = contentCacheRemover; _localizationService = localizationService; _propertyDefinitionRepository = propertyDefinitionRepository; _contentTypeRepository = contentTypeRepository; }
public DependenciesResolver(ContentSoftLinkIndexer contentSoftLinkIndexer, IContentRepository contentRepository, LanguageResolver languageResolver, ContentLoaderService contentLoaderService, ServiceAccessor <SiteDefinition> currentSiteDefinition, UIDescriptorRegistry uiDescriptorRegistry, ServiceAccessor <HttpContextBase> httpContextAccessor, IApprovalDefinitionRepository approvalDefinitionRepository, LocalizationService localizationService) { _contentSoftLinkIndexer = contentSoftLinkIndexer; _contentRepository = contentRepository; _languageResolver = languageResolver; _contentLoaderService = contentLoaderService; _currentSiteDefinition = currentSiteDefinition; _uiDescriptorRegistry = uiDescriptorRegistry; _httpContextAccessor = httpContextAccessor; _approvalDefinitionRepository = approvalDefinitionRepository; _localizationService = localizationService; }
public async Task AddClipsAndHeadersForPlaylist(Playlist playlist) { if (ServiceAccessor.ConnectedToInternet()) { playlist.clips = new BindableCollection <Clip>(); ClipResponse response = await ServiceAccessor.GetPlaylistClipsAndHeaders(playlist.playlistId); if (response.status == SERVICE_RESPONSE.SUCCESS) { playlist.clips = response.clips; playlist.displayColumns = response.DisplayColumns; } else { } } }
public ChangeCartItemPayload( ICartService cartService, CartViewModelFactory cartViewModelFactory, IOrderRepository orderRepository, IRecommendationService recommendationService, ServiceAccessor <HttpContextBase> httpContextBase) { _cartService = cartService; _cartViewModelFactory = cartViewModelFactory; _orderRepository = orderRepository; _recommendationService = recommendationService; _httpContextBase = httpContextBase; Name = "ChangeCartItemPayload"; Field <CartType>("cart"); }
public CheckoutViewModelFactory( LocalizationService localizationService, ServiceAccessor <PaymentMethodViewModelFactory> paymentMethodViewModelFactory, IAddressBookService addressBookService, IContentLoader contentLoader, UrlResolver urlResolver, ServiceAccessor <HttpContextBase> httpContextAccessor, ShipmentViewModelFactory shipmentViewModelFactory) { _localizationService = localizationService; _paymentMethodViewModelFactory = paymentMethodViewModelFactory; _addressBookService = addressBookService; _contentLoader = contentLoader; _urlResolver = urlResolver; _httpContextAccessor = httpContextAccessor; _shipmentViewModelFactory = shipmentViewModelFactory; }
public void Initialize(InitializationEngine context) { var services = context.Locate.Advanced; _contentSyncOptions = services.GetInstance <IContentSyncOptions>(); _contentSyncService = services.GetInstance <ContentSyncService>(); _dataExporterAccessor = services.GetInstance <ServiceAccessor <IDataExporter> >(); _contentLoader = services.GetInstance <IContentLoader>(); if (!_contentSyncOptions.ContentStagingEnabled) { return; } var events = services.GetInstance <IContentEvents>(); events.PublishedContent += Events_PublishedContent; }
public ContentExportProcessor(IPropertyDefinitionRepository propertyDefinitionRepository, IContentTypeRepository contentTypeRepository, ITabDefinitionRepository tabDefinitionRepository, ISiteDefinitionRepository siteDefinitionRepository, CategoryRepository categoryRepository, IVisitorGroupRepository visitorGroupRepository, ServiceAccessor <IFrameRepository> frameRepository, ServiceAccessor <IDataExporter> dataExporterAccessor) { _contentTypeRepository = contentTypeRepository; _propertyDefinitionRepository = propertyDefinitionRepository; _tabDefinitionRepository = tabDefinitionRepository; _siteDefinitionRepository = siteDefinitionRepository; _categoryRepository = categoryRepository; _visitorGroupRepository = visitorGroupRepository; _frameRepository = frameRepository; _dataExporterAccessor = dataExporterAccessor; }
public CartViewModelFactory( IContentLoader contentLoader, ICurrencyService currencyService, IOrderGroupCalculator orderGroupCalculator, ShipmentViewModelFactory shipmentViewModelFactory, ReferenceConverter referenceConverter, UrlResolver urlResolver, ServiceAccessor <HttpContextBase> httpContextAccessor, IAddressBookService addressBookService) { _contentLoader = contentLoader; _currencyService = currencyService; _orderGroupCalculator = orderGroupCalculator; _shipmentViewModelFactory = shipmentViewModelFactory; _referenceConverter = referenceConverter; _urlResolver = urlResolver; _httpContextAccessor = httpContextAccessor; _addressBookService = addressBookService; }
public CheckoutViewModelFactory( LocalizationService localizationService, PaymentMethodViewModelFactory paymentMethodViewModelFactory, IAddressBookService addressBookService, IContentLoader contentLoader, IOrderFactory orderFactory, UrlResolver urlResolver, ServiceAccessor<HttpContextBase> httpContextAccessor, ShipmentViewModelFactory shipmentViewModelFactory) { _localizationService = localizationService; _paymentMethodViewModelFactory = paymentMethodViewModelFactory; _addressBookService = addressBookService; _contentLoader = contentLoader; _orderFactory = orderFactory; _urlResolver = urlResolver; _httpContextAccessor = httpContextAccessor; _shipmentViewModelFactory = shipmentViewModelFactory; }