Ejemplo n.º 1
0
        public LocaleInitializer(
            IContextUtilities contextUtilities,
            IHttpContextFactory httpContextFactory,
            IApplicationContext appContext
            )
        {
            if (contextUtilities == null)
            {
                throw new ArgumentNullException("contextUtilities");
            }
            if (httpContextFactory == null)
            {
                throw new ArgumentNullException("httpContextFactory");
            }
            if (appContext == null)
            {
                throw new ArgumentNullException("appContext");
            }

            this.contextUtilities   = contextUtilities;
            this.httpContextFactory = httpContextFactory;
            this.appContext         = appContext;

            // Execute on creation
            GetLocaleFromContext();
        }
 public DefaultLocaleRedirectRoute(
     IApplicationContext appContext,
     IRouteUtilities routeUtilities,
     IContextUtilities contextUtilities
     )
 {
     if (appContext == null)
         throw new ArgumentNullException("appContext");
     if (routeUtilities == null)
         throw new ArgumentNullException("routeUtilities");
     if (contextUtilities == null)
         throw new ArgumentNullException("contextUtilities");
     this.appContext = appContext;
     this.routeUtilities = routeUtilities;
     this.contextUtilities = contextUtilities;
 }
        public TenantInitializer(
            IContextUtilities contextUtilities,
            IHttpContextFactory httpContextFactory,
            IApplicationContext appContext
            )
        {
            if (contextUtilities == null)
                throw new ArgumentNullException("contextUtilities");
            if (httpContextFactory == null)
                throw new ArgumentNullException("httpContextFactory");
            if (appContext == null)
                throw new ArgumentNullException("appContext");

            // Lookup the current tenant and put it into ambient context on the current request
            var context = httpContextFactory.GetHttpContext();
            appContext.CurrentTenant = contextUtilities.GetTenantFromContext(context);
        }
        public LocaleInitializer(
            IContextUtilities contextUtilities,
            IHttpContextFactory httpContextFactory,
            IApplicationContext appContext
            )
        {
            if (contextUtilities == null)
                throw new ArgumentNullException("contextUtilities");
            if (httpContextFactory == null)
                throw new ArgumentNullException("httpContextFactory");
            if (appContext == null)
                throw new ArgumentNullException("appContext");

            this.contextUtilities = contextUtilities;
            this.httpContextFactory = httpContextFactory;
            this.appContext = appContext;

            // Execute on creation
            GetLocaleFromContext();
        }
Ejemplo n.º 5
0
 public DefaultLocaleRedirectRoute(
     IApplicationContext appContext,
     IRouteUtilities routeUtilities,
     IContextUtilities contextUtilities
     )
 {
     if (appContext == null)
     {
         throw new ArgumentNullException("appContext");
     }
     if (routeUtilities == null)
     {
         throw new ArgumentNullException("routeUtilities");
     }
     if (contextUtilities == null)
     {
         throw new ArgumentNullException("contextUtilities");
     }
     this.appContext       = appContext;
     this.routeUtilities   = routeUtilities;
     this.contextUtilities = contextUtilities;
 }
Ejemplo n.º 6
0
        public TenantInitializer(
            IContextUtilities contextUtilities,
            IHttpContextFactory httpContextFactory,
            IApplicationContext appContext
            )
        {
            if (contextUtilities == null)
            {
                throw new ArgumentNullException("contextUtilities");
            }
            if (httpContextFactory == null)
            {
                throw new ArgumentNullException("httpContextFactory");
            }
            if (appContext == null)
            {
                throw new ArgumentNullException("appContext");
            }

            // Lookup the current tenant and put it into ambient context on the current request
            var context = httpContextFactory.GetHttpContext();

            appContext.CurrentTenant = contextUtilities.GetTenantFromContext(context);
        }