Files
mono/mcs/class/System.Web/System.Web.UI/SimpleHandlerFactory.cs
T
Gonzalo Paniagua Javier 21c46d96a3 2003-08-01 Gonzalo Paniagua Javier <[email protected]>
* System.Web.dll.sources: added WebHandlerParser.cs

	* System.Web.Compilation/Directive.cs: support @WebHandler.

	* System.Web.UI/SimpleHandlerFactory.cs: implemented GetHandler.
	* System.Web.UI/WebHandlerParser.cs: new file that parses .ashx files.

svn path=/trunk/mcs/; revision=16971
2003-08-01 01:09:32 +00:00

34 lines
765 B
C#

//
// System.Web.UI.SimpleHandlerFactory
//
// Authors:
// Gonzalo Paniagua Javier ([email protected])
//
// (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
//
using System.Web;
namespace System.Web.UI
{
class SimpleHandlerFactory : IHttpHandlerFactory
{
public virtual IHttpHandler GetHandler (HttpContext context,
string requestType,
string virtualPath,
string path)
{
Type type = WebHandlerParser.GetCompiledType (context, virtualPath, path);
if (!(typeof (IHttpHandler).IsAssignableFrom (type)))
throw new HttpException ("Type does not implement IHttpHandler: " + type.FullName);
return Activator.CreateInstance (type) as IHttpHandler;
}
public virtual void ReleaseHandler (IHttpHandler handler)
{
}
}
}