Exemplo n.º 1
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (filterContext == null)
            {
                throw new ArgumentNullException("filterContext");
            }
            var ctx   = filterContext.HttpContext;
            var theme = Default;

            if (!string.IsNullOrEmpty(ParamName))
            {
                var th = new RequestPersonalizationParameter <string>(ParamName);

                if (th.LoadFromString(ctx.Request.QueryString[ParamName]))
                {
                    th.Cache();
                }
                else
                {
                    th.LoadFromCache();
                }
                theme = th.Value ?? Default;
            }
            ctx.UpdateTheme(theme);
        }
Exemplo n.º 2
0
		public override void OnActionExecuting(ActionExecutingContext filterContext)
		{
			if (filterContext == null) throw new ArgumentNullException("filterContext");
			var ctx = filterContext.HttpContext;
		    var theme = Default;
            if (!string.IsNullOrEmpty(ParamName))
            {
                var th = new RequestPersonalizationParameter<string>(ParamName);

                if (th.LoadFromString(ctx.Request.QueryString[ParamName]))
                {
                    th.Cache();
                }
                else
                {
                    th.LoadFromCache();
                }
                theme = th.Value ?? Default;
            }
		    ctx.UpdateTheme(theme);
            
		}