2006-06-08 Chris Toshok <toshok@ximian.com>
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / TagPrefixInfo.cs
index fda4da93ad4c1ce1970a413658f2c02d3691df72..ef417df2456742a201966ed63e283171742bf469 100644 (file)
@@ -47,9 +47,14 @@ namespace System.Web.Configuration
                static ConfigurationProperty tagNameProp;
                static ConfigurationProperty sourceProp;
 
+               static ConfigurationElementProperty elementProperty;
+
                static TagPrefixInfo ()
                {
-                       tagPrefixProp = new ConfigurationProperty ("tagPrefix", typeof (string), "/", ConfigurationPropertyOptions.IsRequired);
+                       tagPrefixProp = new ConfigurationProperty ("tagPrefix", typeof (string), "/",
+                                                                  TypeDescriptor.GetConverter (typeof (string)),
+                                                                  PropertyHelper.NonEmptyStringValidator,
+                                                                  ConfigurationPropertyOptions.IsRequired);
                        namespaceProp = new ConfigurationProperty ("namespace", typeof (string));
                        assemblyProp = new ConfigurationProperty ("assembly", typeof (string));
                        tagNameProp = new ConfigurationProperty ("tagName", typeof (string));
@@ -61,6 +66,12 @@ namespace System.Web.Configuration
                        properties.Add (assemblyProp);
                        properties.Add (tagNameProp);
                        properties.Add (sourceProp);
+
+                       elementProperty = new ConfigurationElementProperty (new CallbackValidator (typeof (TagPrefixInfo), ValidateElement));
+               }
+
+               internal TagPrefixInfo ()
+               {
                }
 
                public TagPrefixInfo (string tagPrefix, string nameSpace, string assembly, string tagName, string source)
@@ -72,6 +83,16 @@ namespace System.Web.Configuration
                        this.Source = source;
                }
 
+               [MonoTODO]
+               static void ValidateElement (object o)
+               {
+                       /* XXX do some sort of element validation here? */
+               }
+
+               protected override ConfigurationElementProperty ElementProperty {
+                       get { return elementProperty; }
+               }
+
                public override bool Equals (object prefix)
                {
                        TagPrefixInfo info = prefix as TagPrefixInfo;
@@ -95,13 +116,6 @@ namespace System.Web.Configuration
                        set { base[assemblyProp] = value; }
                }
 
-#if notyet
-               [MonoTODO]
-               protected override ConfigurationElementProperty ElementProperty {
-                       get { return base.ElementProperty; }
-               }
-#endif
-
                [ConfigurationProperty ("namespace")]
                public string Namespace {
                        get { return (string) base[namespaceProp]; }