UserControlParser.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // System.Web.UI.UserControlParser
  3. //
  4. // Authors:
  5. // Gonzalo Paniagua Javier ([email protected])
  6. //
  7. // (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
  8. //
  9. using System;
  10. using System.IO;
  11. using System.Web;
  12. using System.Web.Compilation;
  13. using System.Web.Util;
  14. namespace System.Web.UI
  15. {
  16. internal sealed class UserControlParser : TemplateControlParser
  17. {
  18. internal UserControlParser (string virtualPath, string inputFile, HttpContext context)
  19. {
  20. Context = context;
  21. string vp = UrlUtils.Combine (virtualPath, inputFile);
  22. BaseVirtualDir = UrlUtils.GetDirectory (vp);
  23. InputFile = context.Request.MapPath (vp);
  24. }
  25. public static Type GetCompiledType (string virtualPath, string inputFile, HttpContext context)
  26. {
  27. UserControlParser ucp = new UserControlParser (virtualPath, inputFile, context);
  28. return ucp.CompileIntoType ();
  29. }
  30. protected override Type CompileIntoType ()
  31. {
  32. AspGenerator generator = new AspGenerator (this);
  33. return generator.GetCompiledType ();
  34. }
  35. internal override Type DefaultBaseType
  36. {
  37. get {
  38. return typeof (UserControl);
  39. }
  40. }
  41. internal override string DefaultDirectiveName
  42. {
  43. get {
  44. return "control";
  45. }
  46. }
  47. }
  48. }