X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Web%2FSystem.Web.Compilation%2FUserControlCompiler.cs;h=cf9aeb6dc824c7ec99b0c1bc20f1aabe97325f69;hb=a01fb8227b364663dbc0a8ef50cebf8e6b9563d0;hp=25a755d01d3f78169f4ee9082cc8255225423ce9;hpb=c39d7ce9985a7067c1cbf44188007c9433901940;p=mono.git diff --git a/mcs/class/System.Web/System.Web.Compilation/UserControlCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/UserControlCompiler.cs index 25a755d01d3..cf9aeb6dc82 100644 --- a/mcs/class/System.Web/System.Web.Compilation/UserControlCompiler.cs +++ b/mcs/class/System.Web/System.Web.Compilation/UserControlCompiler.cs @@ -55,33 +55,42 @@ namespace System.Web.Compilation AddOutputCacheAttribute (); } - private void AddOutputCacheAttribute () + protected internal override void CreateMethods () + { + base.CreateMethods (); + CreateProfileProperty (); + } + + 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); + CodeAttributeArgumentCollection arguments = cad.Arguments; + + AddPrimitiveArgument (arguments, parser.OutputCacheDuration); + AddPrimitiveArgument (arguments, parser.OutputCacheVaryByParam); + AddPrimitiveArgument (arguments, parser.OutputCacheVaryByControls); + AddPrimitiveArgument (arguments, parser.OutputCacheVaryByCustom); + AddPrimitiveArgument (arguments, parser.OutputCacheSqlDependency); + AddPrimitiveArgument (arguments, parser.OutputCacheShared); + arguments.Add (new CodeAttributeArgument ("ProviderName", new CodePrimitiveExpression (parser.ProviderName))); mainClass.CustomAttributes.Add (cad); } - private void AddPrimitiveAttribute (CodeAttributeDeclaration cad, object obj) + void AddPrimitiveArgument (CodeAttributeArgumentCollection arguments, object obj) { - cad.Arguments.Add (new CodeAttributeArgument (new CodePrimitiveExpression (obj))); + arguments.Add (new CodeAttributeArgument (new CodePrimitiveExpression (obj))); } - protected override void AddStatementsToInitMethod (CodeMemberMethod method) + protected override void AddStatementsToInitMethodTop (ControlBuilder builder, CodeMemberMethod method) { -#if NET_2_0 + base.AddStatementsToInitMethodTop (builder, method); if (parser.MasterPageFile != null) { CodeExpression prop; prop = new CodePropertyReferenceExpression (new CodeArgumentReferenceExpression("__ctrl"), "MasterPageFile"); CodeExpression ct = new CodePrimitiveExpression (parser.MasterPageFile); - method.Statements.Add (new CodeAssignStatement (prop, ct)); + method.Statements.Add (AddLinePragma (new CodeAssignStatement (prop, ct), parser.DirectiveLocation)); } -#endif } } }