From 201982bea991b813fe3dd778b5b8f161c594b824 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Wed, 30 Apr 2003 20:07:26 +0000 Subject: 2003-04-30 Gonzalo Paniagua Javier * System.Web.Compilation/TemplateControlCompiler.cs: correctly set the TemplateSourceDirectory value. * System.Web.UI/ApplicationFileParser.cs: store the Context and override BaseVirtualDir so that it's the application path. * System.Web.UI/BaseParser.cs: removed CurrentVirtualPath property. * System.Web.UI/TemplateControlParser.cs: use BaseVirtualDir. * System.Web.UI/UserControlParser.cs: removed CurrentVirtualPath. svn path=/trunk/mcs/; revision=14168 --- mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs | 9 +++++++-- mcs/class/System.Web/System.Web.UI/BaseParser.cs | 9 +-------- mcs/class/System.Web/System.Web.UI/ChangeLog | 11 +++++++++++ mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs | 4 ++-- mcs/class/System.Web/System.Web.UI/UserControlParser.cs | 1 - 5 files changed, 21 insertions(+), 13 deletions(-) (limited to 'mcs/class/System.Web/System.Web.UI') diff --git a/mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs b/mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs index 0430d7e0cc7..780f33f0db1 100644 --- a/mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs +++ b/mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs @@ -14,9 +14,10 @@ namespace System.Web.UI { sealed class ApplicationFileParser : TemplateParser { - public ApplicationFileParser (string fname) + public ApplicationFileParser (string fname, HttpContext context) { InputFile = fname; + Context = context; } protected override Type CompileIntoType () @@ -27,7 +28,7 @@ namespace System.Web.UI internal static Type GetCompiledApplicationType (string inputFile, HttpContext context) { - ApplicationFileParser parser = new ApplicationFileParser (inputFile); + ApplicationFileParser parser = new ApplicationFileParser (inputFile, context); parser.Context = context; return parser.CompileIntoType (); } @@ -39,6 +40,10 @@ namespace System.Web.UI protected internal override string DefaultDirectiveName { get { return "application"; } } + + internal override string BaseVirtualDir { + get { return Context.Request.ApplicationPath; } + } } } diff --git a/mcs/class/System.Web/System.Web.UI/BaseParser.cs b/mcs/class/System.Web/System.Web.UI/BaseParser.cs index e314e9d2326..91aae69bbf8 100755 --- a/mcs/class/System.Web/System.Web.UI/BaseParser.cs +++ b/mcs/class/System.Web/System.Web.UI/BaseParser.cs @@ -21,7 +21,6 @@ namespace System.Web.UI private HttpContext context; private string baseDir; private string baseVDir; - private string vPath; internal string MapPath (string path) { @@ -89,7 +88,7 @@ namespace System.Web.UI } } - internal string BaseVirtualDir { + internal virtual string BaseVirtualDir { get { if (baseVDir == null) baseVDir = UrlUtils.GetDirectory (context.Request.FilePath); @@ -97,12 +96,6 @@ namespace System.Web.UI return baseVDir; } } - - internal string CurrentVirtualPath { - get { return vPath; } - set { vPath = value; } - } } - } diff --git a/mcs/class/System.Web/System.Web.UI/ChangeLog b/mcs/class/System.Web/System.Web.UI/ChangeLog index 0188ec1e979..0c2d3f2969c 100644 --- a/mcs/class/System.Web/System.Web.UI/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI/ChangeLog @@ -1,3 +1,14 @@ +2003-04-30 Gonzalo Paniagua Javier + + * ApplicationFileParser.cs: store the Context and override + BaseVirtualDir so that it's the application path. + + * BaseParser.cs: removed CurrentVirtualPath property. + + * TemplateControlParser.cs: use BaseVirtualDir. + + * UserControlParser.cs: removed CurrentVirtualPath. + 2003-04-30 Gonzalo Paniagua Javier * TemplateParser.cs: always reference all the assemblies in bin diff --git a/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs b/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs index cc5b005ef9a..75f464a1a8d 100644 --- a/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs +++ b/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs @@ -88,8 +88,8 @@ namespace System.Web.UI "must be .ascx"); - AddDependency (Path.Combine (MapPath (CurrentVirtualPath), src)); - Type type = UserControlParser.GetCompiledType (CurrentVirtualPath, src, Context); + AddDependency (Path.Combine (MapPath (BaseVirtualDir), src)); + Type type = UserControlParser.GetCompiledType (BaseVirtualDir, src, Context); AddAssembly (type.Assembly, true); RootBuilder.Foundry.RegisterFoundry (tagprefix, tagname, type); return; diff --git a/mcs/class/System.Web/System.Web.UI/UserControlParser.cs b/mcs/class/System.Web/System.Web.UI/UserControlParser.cs index 169f06b59c3..f47bf85d256 100644 --- a/mcs/class/System.Web/System.Web.UI/UserControlParser.cs +++ b/mcs/class/System.Web/System.Web.UI/UserControlParser.cs @@ -18,7 +18,6 @@ namespace System.Web.UI internal UserControlParser (string virtualPath, string inputFile, HttpContext context) { Context = context; - CurrentVirtualPath = virtualPath; InputFile = Path.Combine (context.Request.MapPath (virtualPath), inputFile); } -- cgit v1.2.3