2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / System.Web / System.Web.UI / TemplateBuilder.cs
index 78d591f8f6c14b1e85a78b27a99a47908a034887..f779c5db09c4e8dfdac5ea7f041be1c58a55f793 100644 (file)
 
 using System;
 using System.Collections;
+using System.Reflection;
 
 namespace System.Web.UI
 {
        public class TemplateBuilder : ControlBuilder, ITemplate
        {
                string text;
+               TemplateContainerAttribute containerAttribute;
 
                public TemplateBuilder ()
                {
                }
 
+               internal TemplateBuilder (ICustomAttributeProvider prov)
+               {
+                       object[] ats = prov.GetCustomAttributes (typeof(TemplateContainerAttribute), true);
+                       if (ats.Length > 0) {
+                               containerAttribute = (TemplateContainerAttribute) ats [0];
+                       }
+               }
+
                public virtual string Text {
                        get { return text; }
                        set { text = value; }
                }
+               
+               internal Type ContainerType {
+                       get { return containerAttribute != null ? containerAttribute.ContainerType : null; }
+               }
 
                public override void Init (TemplateParser parser,
                                          ControlBuilder parentBuilder,