Merge pull request #2781 from alexanderkyte/inflated_method_header_leak
[mono.git] / mcs / class / System.Web / System.Web.Compilation / UserControlCompiler.cs
index 1e95ef7c2c722e3b00be6c9d4d3478bf16c5a673..cf9aeb6dc824c7ec99b0c1bc20f1aabe97325f69 100644 (file)
@@ -55,41 +55,42 @@ namespace System.Web.Compilation
                                AddOutputCacheAttribute ();
                }
 
-#if NET_2_0
                protected internal override void CreateMethods ()
                {
                        base.CreateMethods ();
                        CreateProfileProperty ();
                }
-#endif
                
                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);
                }
 
-               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 (AddLinePragma (new CodeAssignStatement (prop, ct), parser.DirectiveLocation));
                        }
-#endif
                }
        }
 }