/// <summary>
        /// Returns an instance of <c>ScriptKeeper</c> that can be used to register
        /// script files in the current context.
        /// </summary>
        /// <returns>
        /// The instance of <c>ScriptKeeper</c>.
        /// </returns>
        /// <param name='html'>
        /// The instance of <c>HtmlHelper</c> that will return a <c>ScriptKeeper</c>.
        /// </param>
        /// <exception cref='ArgumentNullException'>
        /// Thrown if <paramref name="html"/> is <see langword="null" /> .
        /// </exception>
        public static ScriptKeeper ScriptKeeper(this HtmlHelper html)
        {
            if (html == null)
            {
                throw new ArgumentNullException("html");
            }

            var viewContext  = html.ViewContext;
            var httpContext  = viewContext.HttpContext;
            var scriptKeeper = httpContext.Items[ScriptKeeperKey] as ScriptKeeper;

            if (scriptKeeper == null)
            {
                var keeperHelper = new RequestContextHelper(viewContext.RequestContext);

                httpContext.Items[ScriptKeeperKey] = scriptKeeper = new ScriptKeeper(keeperHelper);
            }

            return(scriptKeeper);
        }
Esempio n. 2
0
        // Token: 0x06000FDB RID: 4059 RVA: 0x00062DE0 File Offset: 0x00060FE0
        private void OnPostAuthorizeRequest(object sender, EventArgs e)
        {
            ExTraceGlobals.CoreCallTracer.TraceDebug(0L, "OwaModule.OnPostAuthorizeRequest");
            HttpApplication httpApplication = (HttpApplication)sender;

            if (this.ShouldInterceptRequest(httpApplication.Context, false))
            {
                if (!Globals.IsInitialized)
                {
                    return;
                }
                this.requestInspector.OnPostAuthorizeRequest(sender, e);
                if (httpApplication.Context.Response.Headers["X-Frame-Options"] == null && !RequestContextHelper.IsSuiteServiceProxyRequestType(httpApplication))
                {
                    httpApplication.Context.Response.Headers.Set("X-Frame-Options", "SAMEORIGIN");
                }
            }
        }
Esempio n. 3
0
 public static UrlHelper Create(HttpContextBase context)
 {
     return(Create(RequestContextHelper.Create(context)));
 }
Esempio n. 4
0
 public static UrlHelper Create(Uri url = null, Func <IDictionary <string, object>, bool> onFillOwinData = null)
 {
     return(Create(RequestContextHelper.Create(url, onFillOwinData)));
 }