当前位置: 首页>>代码示例>>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;未经允许,请勿转载。