public LanguageService(ICurrentMarket currentMarket, CookieService cookieService, IUpdateCurrentLanguage defaultUpdateCurrentLanguage, RequestContext requestContext) { _currentMarket = currentMarket; _cookieService = cookieService; _defaultUpdateCurrentLanguage = defaultUpdateCurrentLanguage; _requestContext = requestContext; }
public LanguageService(ICurrentMarket currentMarket, CookieService cookieService, IUpdateCurrentLanguage defaultUpdateCurrentLanguage) { _currentMarket = currentMarket; _cookieService = cookieService; _defaultUpdateCurrentLanguage = defaultUpdateCurrentLanguage; }
/// <summary>Send subscription data to handler</summary> /// <param name="profile">The profile for a subscriber</param> /// <param name="rootPage">Root for subscription</param> /// <param name="changedPages">The pages that has changed</param> protected virtual void SendToHandler(EPiServerProfile profile, PageData rootPage, PageDataCollection changedPages) { IUpdateCurrentLanguage instance = ServiceLocator.Current.GetInstance <IUpdateCurrentLanguage>(); if (this._languageBranchRepository.Load(profile.Language) != null) { instance.UpdateLanguage(profile.Language); } else { instance.UpdateLanguage(ContentLanguage.Instance.FinalFallbackCulture.Name); } string subscriptionHandler1 = SubscriptionJob.FindSubscriptionHandler(rootPage); SubscriptionJob.log.Debug((object)string.Format("Start processing subscription mail for {0}", (object)profile.DisplayName)); SubscriptionJob.log.Debug((object)string.Format("Uses subscription handler: {0}", subscriptionHandler1.Length == 0 ? (object)"Default" : (object)subscriptionHandler1)); ISubscriptionHandler subscriptionHandler2; if (string.IsNullOrEmpty(subscriptionHandler1)) { subscriptionHandler2 = (ISubscriptionHandler) new Gosso.EpiserverLegacy.Personalization.Internal.SubscriptionMail(this._localizationService, this._siteDefinitionResolver); } else { subscriptionHandler2 = Activator.CreateInstance(Type.GetType(subscriptionHandler1, true, true)) as ISubscriptionHandler; if (subscriptionHandler2 == null) { throw new EPiServerException(string.Format("Failed to create a instance of \"{0}\", does it implement ISubscriptionHandler?", (object)Settings.Instance.SubscriptionHandler)); } } subscriptionHandler2.User = profile.UserName; subscriptionHandler2.UserData = profile; try { subscriptionHandler2.Send(rootPage, changedPages); SubscriptionJob.log.Debug((object)string.Format("Finished processing subscription mail for {0}", (object)profile.DisplayName)); } catch (ConfigurationErrorsException ex) { SubscriptionJob.log.Error((object)string.Format("Failed to send subscription to {0} due to a configuration error", (object)profile.DisplayName), (Exception)ex); throw; } catch (SmtpException ex) { SubscriptionJob.log.Error((object)string.Format("Failed to send subscription to {0}", (object)profile.DisplayName), (Exception)ex); if (ex.StatusCode == SmtpStatusCode.MailboxUnavailable) { return; } throw; } catch (Exception ex) { SubscriptionJob.log.Error((object)string.Format("Failed to send subscription to {0}", (object)profile.DisplayName), ex); } }
public CustomUpdateCurrentLanguage(IUpdateCurrentLanguage existingClass) { _existingClass = existingClass; }
public ErrorPagesController(ILanguageSegmentMatcher languageSegmentMatcher, IUpdateCurrentLanguage updateCurrentLanguage) : base(languageSegmentMatcher, updateCurrentLanguage) { }
public LocalizedNonContentControllerBase(ILanguageSegmentMatcher languageSegmentMatcher, IUpdateCurrentLanguage updateCurrentLanguage) { LanguageSegmentMatcher = languageSegmentMatcher; UpdateCurrentLanguage = updateCurrentLanguage; }
public AccountController(ILanguageSegmentMatcher languageSegmentMatcher, IUpdateCurrentLanguage updateCurrentLanguage, IUserAuthenticationHandler userAuthentication, LocalizationService localizationService) : base(languageSegmentMatcher, updateCurrentLanguage) { UserAuthentication = userAuthentication; LocalizationService = localizationService; }