HandlerItem.cs 965 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // System.Web.Configuration.HandlerItem
  3. //
  4. // Author:
  5. // Patrik Torstensson ([email protected])
  6. //
  7. using System;
  8. namespace System.Web.Configuration {
  9. public class HandlerItem {
  10. private Type _type;
  11. private string _typeName;
  12. private string _path;
  13. private string _requestType;
  14. public HandlerItem(string requestType, string path, string type) {
  15. _typeName = type;
  16. _path = path;
  17. _requestType = requestType.Replace(" ", "");
  18. _type = Type.GetType(type, true);
  19. if (!typeof(IHttpHandler).IsAssignableFrom(_type)) {
  20. if (!typeof(IHttpHandlerFactory).IsAssignableFrom(_type)) {
  21. throw new HttpException(HttpRuntime.FormatResourceString("type_not_factory_or_handler"));
  22. }
  23. }
  24. }
  25. public object Create() {
  26. return HttpRuntime.CreateInternalObject(_type);
  27. }
  28. public Type Type {
  29. get {
  30. return _type;
  31. }
  32. }
  33. [MonoTODO()]
  34. public bool IsMatch(string type, string path) {
  35. // Debugging
  36. return true;
  37. }
  38. }
  39. }