class MyCustomGetHandler : IMethodHandler
{
public IMethodHandler OriginalHandler { get; set; }
public bool EnableOutputBuffering
{
get { return false; }
}
public bool EnableOutputDebugLogging
{
get { return false; }
}
public bool EnableInputDebugLogging
{
get { return false; }
}
/// <summary>
/// Handles GET request.
/// </summary>
/// <param name="context">Instace of <see cref="DavContextBase"/>.</param>
/// <param name="item">Instance of <see cref="IHierarchyItem"/> which was returned by
/// <see cref="DavContextBase.GetHierarchyItem"/> for this request.</param>
public void ProcessRequest(DavContextBase context, IHierarchyItem item)
{
if (item is IFolder)
{
// Remember to call EnsureBeforeResponseWasCalled here if your context implementation
// makes some useful things in BeforeResponse.
context.EnsureBeforeResponseWasCalled();
Page page = (Page)System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(
"~/MyCustomHandlerPage.aspx", typeof(Page));
page.ProcessRequest(HttpContext.Current);
}
else
{
OriginalHandler.ProcessRequest(context, item);
}
}
public bool AppliesTo(IHierarchyItem item)
{
return item is IFolder || OriginalHandler.AppliesTo(item);
}
}