Files
mono/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs
T
Gonzalo Paniagua Javier 8e91ed0203 2002-12-18 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HttpApplicationFactory.cs: add the context as parameter
	when building the application Type.

	* System.Web/HttpCookie.cs: new internal constructor.
	* System.Web/HttpCookieCollection.cs: new internal method to make a
	cookie expire.

	* System.Web/HttpRequest.cs: MapPath fixes.
	* System.Web/HttpResponse.cs: implemented ApplyAppPathModifier.
	* System.Web/HttpRuntime.cs: fixed typo in AppDomainAppVirtualPath.
	* System.Web.Compilation/AspGenerator.cs: now it uses the current
	HttpContext when creating user controls. TemplateSourceDirectory is no
	longer a dummy value.

	* System.Web.Compilation/GlobalAsaxCompiler.cs:
	* System.Web.Compilation/PageCompiler.cs:
	* System.Web.Compilation/UserControlCompiler.cs: set the context which
	will be used to locate the files.

	* System.Web.UI/BaseParser.cs: use MapPath and context to locate files.
	* System.Web.UI/Control.cs: implemented MapPathSecure.
	* System.Web.UI/TemplateControl.cs: use UrlUtils to generate the path.
	* System.Web.UI/TemplateControlParser.cs: use the context and MapPath.
	* System.Web.UI/UserControl.cs: implemented MapPath.
	* System.Web.UI/UserControlParser.cs: added context parameter to
	constructor.
	* System.Web.Util/PathUtil.cs: removed.
	* System.Web.Util/UrlUtils.cs: fixed Combine to handle '~'.

svn path=/trunk/mcs/; revision=9737
2002-12-18 02:17:17 +00:00

48 lines
1009 B
C#

//
// System.Web.UI.TemplateControlParser
//
// Authors:
// Gonzalo Paniagua Javier ([email protected])
//
// (C) 2002 Ximian, Inc (http://www.ximian.com)
//
using System;
using System.Collections;
using System.IO;
using System.Web.Compilation;
using System.Web.Util;
namespace System.Web.UI
{
public abstract class TemplateControlParser : TemplateParser
{
internal object GetCompiledInstance (string virtualPath, string inputFile, HttpContext context)
{
Context = context;
InputFile = MapPath (virtualPath);
Type type = CompileIntoType ();
if (type == null)
return null;
object ctrl = Activator.CreateInstance (type);
if (ctrl == null)
return null;
HandleOptions (ctrl);
return ctrl;
}
protected override void HandleOptions (object obj)
{
Control ctrl = obj as Control;
Hashtable options = Options;
if (options == null)
return;
if (options ["AutoEventWireup"] != null)
ctrl.AutoEventWireup = (bool) options ["AutoEventWireup"];
}
}
}