本文整理汇总了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);
}
示例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);
}
示例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);
}