private static IHttpHandler FindHandler(string name) { Debug.Assert(name != null); switch (name) { case "detail": return(CreateTemplateHandler <ErrorDetailPage>()); case "html": return(new ErrorHtmlPage()); case "delete": return(new DelegatingHttpHandler(ErrorDeletionHandler.ProcessRequest)); case "truncate": return(new DelegatingHttpHandler(ErrorTruncationHandler.ProcessRequest)); case "xml": return(new DelegatingHttpHandler(ErrorXmlHandler.ProcessRequest)); case "json": return(new DelegatingHttpHandler(ErrorJsonHandler.ProcessRequest)); case "rss": return(new DelegatingHttpHandler(ErrorRssHandler.ProcessRequest)); case "digestrss": return(new DelegatingHttpHandler(ErrorDigestRssHandler.ProcessRequest)); case "download": #if NET_3_5 || NET_4_0 return(new HttpAsyncHandler((context, getAsyncCallback) => HttpTextAsyncHandler.Create(ErrorLogDownloadHandler.ProcessRequest)(context, getAsyncCallback))); #else return(new DelegatingHttpTaskAsyncHandler(ErrorLogDownloadHandler.ProcessRequestAsync)); #endif case "stylesheet": return(new DelegatingHttpHandler(ManifestResourceHandler.Create(StyleSheetHelper.StyleSheetResourceNames, "text/css", Encoding.GetEncoding("Windows-1252"), true))); case "test": throw new TestException(); case "about": return(CreateTemplateHandler <AboutPage>()); default: return(name.Length == 0 ? CreateTemplateHandler <ErrorLogPage>() : null); } }