mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
* 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
56 lines
1.4 KiB
C#
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)));
|
|
}
|
|
}
|
|
}
|
|
|