mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 12:31:30 -10:00
* 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
59 lines
1.2 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|