當前位置: 首頁>>代碼示例>>C#>>正文


C# HttpContextBase.DisposeOnPipelineCompleted方法代碼示例

本文整理匯總了C#中System.Web.HttpContextBase.DisposeOnPipelineCompleted方法的典型用法代碼示例。如果您正苦於以下問題:C# HttpContextBase.DisposeOnPipelineCompleted方法的具體用法?C# HttpContextBase.DisposeOnPipelineCompleted怎麽用?C# HttpContextBase.DisposeOnPipelineCompleted使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Web.HttpContextBase的用法示例。


在下文中一共展示了HttpContextBase.DisposeOnPipelineCompleted方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: PluploadContext

        internal PluploadContext(HttpContextBase httpContext)
        {
            _httpContext = httpContext;
            _files = new Dictionary<string, PluploadFile>(StringComparer.OrdinalIgnoreCase);

            _httpContext.DisposeOnPipelineCompleted(this);
        }
開發者ID:CoreBe,項目名稱:PluploadMvc,代碼行數:7,代碼來源:PluploadContext.cs

示例2: WebSecurity

 public WebSecurity(HttpContextBase httpContext, ApplicationContext applicationContext)
 {
     _httpContext = httpContext;
     _applicationContext = applicationContext;
     //This ensures the dispose method is called when the request terminates, though
     // we also ensure this happens in the Umbraco module because the UmbracoContext is added to the
     // http context items.
     _httpContext.DisposeOnPipelineCompleted(this);
 }
開發者ID:phaniarveti,項目名稱:Experiments,代碼行數:9,代碼來源:WebSecurity.cs

示例3: UmbracoContext

        /// <summary>
        /// Creates a new Umbraco context.
        /// </summary>
        /// <param name="httpContext"></param>
        /// <param name="applicationContext"> </param>
        /// <param name="publishedCaches">The published caches.</param>
        /// <param name="webSecurity"></param>
        /// <param name="preview">An optional value overriding detection of preview mode.</param>
        internal UmbracoContext(
            HttpContextBase httpContext,
            ApplicationContext applicationContext,
            IPublishedCaches publishedCaches,
            WebSecurity webSecurity,
            bool? preview = null)
        {
            //This ensures the dispose method is called when the request terminates, though
            // we also ensure this happens in the Umbraco module because the UmbracoContext is added to the
            // http context items.
            httpContext.DisposeOnPipelineCompleted(this);

            if (httpContext == null) throw new ArgumentNullException("httpContext");
            if (applicationContext == null) throw new ArgumentNullException("applicationContext");

            ObjectCreated = DateTime.Now;
            UmbracoRequestId = Guid.NewGuid();

            HttpContext = httpContext;
            Application = applicationContext;
            Security = webSecurity;

            ContentCache = publishedCaches.CreateContextualContentCache(this);
            MediaCache = publishedCaches.CreateContextualMediaCache(this);
            _previewing = preview;
            
            // set the urls...
            //original request url
            //NOTE: The request will not be available during app startup so we can only set this to an absolute URL of localhost, this
            // is a work around to being able to access the UmbracoContext during application startup and this will also ensure that people
            // 'could' still generate URLs during startup BUT any domain driven URL generation will not work because it is NOT possible to get
            // the current domain during application startup.
            // see: http://issues.umbraco.org/issue/U4-1890

            var requestUrl = new Uri("http://localhost");
            var request = GetRequestFromContext();
            if (request != null)
            {
                requestUrl = request.Url;
            }
            this.OriginalRequestUrl = requestUrl;
            //cleaned request url
            this.CleanedUmbracoUrl = UriUtility.UriToUmbraco(this.OriginalRequestUrl);

        } 
開發者ID:phaniarveti,項目名稱:Experiments,代碼行數:53,代碼來源:UmbracoContext.cs


注:本文中的System.Web.HttpContextBase.DisposeOnPipelineCompleted方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。