예제 #1
0
        public static GlimpseMode GetGlimpseMode(this HttpApplication application)
        {
            var cookies = application.Request.Cookies;

            var cookie = cookies[GlimpseConstants.CookieModeKey];

            if (cookie == null)
            {
                return(GlimpseMode.Off);
            }

            var mode = GlimpseMode.Off;

            if (!GlimpseMode.TryParse(cookie.Value, true, out mode))
            {
                return(GlimpseMode.Off);
            }

            return(mode);
        }
예제 #2
0
        internal static GlimpseMode GetGlimpseMode(this HttpContextBase context)
        {
            var cookies = context.Request.Cookies;

            var cookie = cookies[GlimpseConstants.CookieModeKey];

            if (cookie == null)
            {
                return(GlimpseMode.Off);
            }

            var mode = GlimpseMode.Off;

            if (!GlimpseMode.TryParse(cookie.Value, true, out mode))
            {
                return(GlimpseMode.Off);
            }

            return(mode);
        }