Files
mono/mcs/class/System.Web/System.Web.UI/TemplateParser.cs
T
Gonzalo Paniagua Javier f9e281c517 2003-04-15 Gonzalo Paniagua Javier <[email protected]>
* list: added CollectionBuilder and TemplateBuilder.
	* System.Web.UI/CollectionBuilder.cs:
	* System.Web.UI/TemplateBuilder.cs: new classes derived from
	ControlBuilder that represent a property or a ITemplate.

	* System.Web.UI/ControlBuilder.cs: implemented all the missing bits.
	* System.Web.UI/TemplateParser.cs: added mapping from tag name to
	Type feature.

svn path=/trunk/mcs/; revision=13632
2003-04-15 03:00:06 +00:00

72 lines
1.2 KiB
C#
Executable File

//
// System.Web.UI.TemplateParser
//
// Authors:
// Duncan Mak ([email protected])
// Gonzalo Paniagua Javier ([email protected])
//
// (C) 2002 Ximian, Inc. (http://www.ximian.com)
//
using System;
using System.Collections;
using System.Web;
namespace System.Web.UI
{
internal delegate Type TagMapper (string tag);
public abstract class TemplateParser : BaseParser
{
string inputFile;
string text;
Hashtable options;
TagMapper mapper;
protected abstract Type CompileIntoType ();
protected virtual void HandleOptions (object obj)
{
}
internal void SetTagMapper (TagMapper mapper)
{
this.mapper = mapper;
}
internal Type GetTypeFromTag (string tag)
{
if (mapper == null)
throw new HttpException ("No tag mapper set!");
return mapper (tag);
}
protected abstract Type DefaultBaseType { get; }
protected abstract string DefaultDirectiveName { get; }
internal string InputFile
{
get { return inputFile; }
set { inputFile = value; }
}
internal string Text
{
get { return text; }
set { text = value; }
}
internal Type BaseType
{
get { return DefaultBaseType; }
}
internal Hashtable Options {
get { return options; }
set { options = value; }
}
}
}