SimpleHandlerFactory.cs 765 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // System.Web.UI.SimpleHandlerFactory
  3. //
  4. // Authors:
  5. // Gonzalo Paniagua Javier ([email protected])
  6. //
  7. // (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
  8. //
  9. using System.Web;
  10. namespace System.Web.UI
  11. {
  12. class SimpleHandlerFactory : IHttpHandlerFactory
  13. {
  14. public virtual IHttpHandler GetHandler (HttpContext context,
  15. string requestType,
  16. string virtualPath,
  17. string path)
  18. {
  19. Type type = WebHandlerParser.GetCompiledType (context, virtualPath, path);
  20. if (!(typeof (IHttpHandler).IsAssignableFrom (type)))
  21. throw new HttpException ("Type does not implement IHttpHandler: " + type.FullName);
  22. return Activator.CreateInstance (type) as IHttpHandler;
  23. }
  24. public virtual void ReleaseHandler (IHttpHandler handler)
  25. {
  26. }
  27. }
  28. }