Files
mono/mcs/class/System.Web/System.Web.Configuration/HandlerItem.cs
T
Gonzalo Paniagua Javier 597d5d0d0c 2002-10-06 Gonzalo Paniagua Javier <[email protected]>
* list: added new files in System.Web.Configuration.
	* System.Web.Configuration/HandlerFactoryConfiguration.cs: removed.

	* System.Web.Configuration/HandlerItem.cs: added validation field.

	* System.Web.Configuration/HttpHandlerTypeMapper.cs: holds mappings
	between verbs and wilcards and their associated HandlerItem.

	* System.Web.Configuration/HttpHandlersSectionHandler.cs: this one
	processes system.web/httpHandlers section of machine.config file.

svn path=/trunk/mcs/; revision=8030
2002-10-06 03:46:53 +00:00

59 lines
1.2 KiB
C#

//
// System.Web.Configuration.HandlerItem
//
// Author:
// Patrik Torstensson ([email protected])
//
using System;
namespace System.Web.Configuration {
public class HandlerItem {
private Type _type;
private string _typeName;
private string _path;
private string _requestType;
bool validate;
public HandlerItem(string requestType, string path, string type, bool validate) {
_typeName = type;
_path = path;
_requestType = requestType.Replace(" ", "");
this.validate = validate;
_type = Type.GetType(type, true);
if (!typeof(IHttpHandler).IsAssignableFrom(_type)) {
if (!typeof(IHttpHandlerFactory).IsAssignableFrom(_type)) {
throw new HttpException(HttpRuntime.FormatResourceString("type_not_factory_or_handler"));
}
}
}
public object Create() {
return HttpRuntime.CreateInternalObject(_type);
}
public Type Type {
get {
return _type;
}
}
public bool IsMatch (string type, string path)
{
return (MatchVerb (type) && MatchExtension (path));
}
bool MatchVerb (string verb)
{
//FIXME: implement me
return true;
}
bool MatchExtension (string path)
{
//FIXME: implement me
return true;
}
}
}