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); }
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); }