Files
mono/mcs/class/System.Web/System.Web.Compilation/UserControlCompiler.cs
T
Gonzalo Paniagua Javier be31b0ce2d 2004-06-16 Gonzalo Paniagua Javier <[email protected]>
* System.Web.Compilation/BaseCompiler.cs: try getting the Type from
	the cache before doing the real work. Remove temporary files right after
	successful compilation.

	* System.Web.Compilation/CachingCompiler.cs: added GetTypeFromCache.

	* System.Web.Compilation/UserControlCompiler.cs: nothing interesting.

	* System.Web.Compilation/WebServiceCompiler.cs: try getting the Type
	from the cache before doing anything else. Remove temp files on
	sucessful compilation.

	* System.Web.UI/SimpleWebHandlerParser.cs: implemented
	GetCompiledTypeFromCache. When we read the default directive, check the
	cache for the Type and if present, don't keep reading and store the
	type found.

	* System.Web.UI/WebHandlerParser.cs:
	* System.Web.UI/WebServiceParser.cs: try GetCompiledTypeFromCache
	before actually compiling.

svn path=/trunk/mcs/; revision=29652
2004-06-16 01:41:10 +00:00

56 lines
1.4 KiB
C#

//
// System.Web.Compilation.UserControlCompiler
//
// Authors:
// Gonzalo Paniagua Javier ([email protected])
//
// (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
//
using System;
using System.CodeDom;
using System.Web.UI;
namespace System.Web.Compilation
{
class UserControlCompiler : TemplateControlCompiler
{
UserControlParser parser;
public UserControlCompiler (UserControlParser parser)
: base (parser)
{
this.parser = parser;
}
public static Type CompileUserControlType (UserControlParser parser)
{
UserControlCompiler pc = new UserControlCompiler (parser);
return pc.GetCompiledType ();
}
protected override void AddClassAttributes ()
{
if (parser.OutputCache)
AddOutputCacheAttribute ();
}
private void AddOutputCacheAttribute ()
{
CodeAttributeDeclaration cad;
cad = new CodeAttributeDeclaration ("System.Web.UI.PartialCachingAttribute");
AddPrimitiveAttribute (cad, parser.OutputCacheDuration);
AddPrimitiveAttribute (cad, parser.OutputCacheVaryByParam);
AddPrimitiveAttribute (cad, parser.OutputCacheVaryByControls);
AddPrimitiveAttribute (cad, parser.OutputCacheVaryByCustom);
AddPrimitiveAttribute (cad, parser.OutputCacheShared);
mainClass.CustomAttributes.Add (cad);
}
private void AddPrimitiveAttribute (CodeAttributeDeclaration cad, object obj)
{
cad.Arguments.Add (new CodeAttributeArgument (new CodePrimitiveExpression (obj)));
}
}
}