Files
mono/mcs/class/System.Web/System.Web.UI/PageParser.cs
T
Gonzalo Paniagua Javier a3e7d18173 2003-05-01 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HtmlizedException.cs: added more virtual methods.

	* System.Web/HttpException.cs:  some work on the output when there's
	a source file present.

	* System.Web.Compilation/AspGenerator.cs: copy the location before
	setting the value for the control builders.

	* System.Web.Compilation/BaseCompiler.cs: changed parameters for
	CompilationException.

	* System.Web.Compilation/CompilationException.cs: it takes now line
	numbers and error descriptions from the CompilerErrorCollection.

	* System.Web.Compilation/Location.cs: used when a copy of an ILocation
	is needed.

	* System.Web.Compilation/ParseException.cs: implemented new methods
	to provide line numbers and souce file.

	* System.Web.Compilation/TemplateControlCompiler.cs: throw a
	ParseException where appropiate.

	* System.Web.UI/BaseParser.cs: Location property is now here. Added a
	couple of convenience methods to throw a ParseException.

	* System.Web.UI/TemplateParser.cs:
	* System.Web.UI/TemplateControlParser.cs:
	* System.Web.UI/PageParser.cs: throw ParseException where appropiate.

svn path=/trunk/mcs/; revision=14191
2003-05-01 19:34:32 +00:00

91 lines
2.3 KiB
C#

//
// System.Web.UI.PageParser
//
// Authors:
// Gonzalo Paniagua Javier ([email protected])
//
// (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
//
using System;
using System.Collections;
using System.Web;
using System.Web.Compilation;
namespace System.Web.UI
{
public sealed class PageParser : TemplateControlParser
{
bool enableSessionState = true;
bool readonlySessionState;
public static IHttpHandler GetCompiledPageInstance (string virtualPath,
string inputFile,
HttpContext context)
{
PageParser pp = new PageParser ();
IHttpHandler h = (IHttpHandler) pp.GetCompiledInstance (virtualPath, inputFile, context);
return h;
}
internal override void ProcessMainAttributes (Hashtable atts)
{
string enabless = GetString (atts, "EnableSessionState", null);
if (enabless != null) {
readonlySessionState = (String.Compare (enabless, "readonly", true) == 0);
if (readonlySessionState == true || String.Compare (enabless, "true", true) == 0) {
enableSessionState = true;
} else if (String.Compare (enabless, "false", true) == 0) {
enableSessionState = false;
} else {
ThrowParseException ("Invalid value for EnableSessionState: " + enabless);
}
}
// Ignored by now
GetString (atts, "Buffer", null);
GetString (atts, "ClientTarget", null);
GetString (atts, "CodePage", null);
GetString (atts, "ContentType", null);
GetString (atts, "Culture", null);
GetString (atts, "EnableViewStateMac", null);
GetString (atts, "ErrorPage", null);
GetString (atts, "LCID", null);
GetString (atts, "ResponseEncoding", null);
GetString (atts, "Trace", null);
GetString (atts, "TraceMode", null);
GetString (atts, "UICulture", null);
base.ProcessMainAttributes (atts);
}
protected override Type CompileIntoType ()
{
AspGenerator generator = new AspGenerator (this);
return generator.GetCompiledType ();
}
internal bool EnableSessionState {
get { return enableSessionState; }
}
internal bool ReadOnlySessionState {
get { return readonlySessionState; }
}
protected override Type DefaultBaseType
{
get {
return typeof (Page);
}
}
protected internal override string DefaultDirectiveName
{
get {
return "page";
}
}
}
}