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));
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)
}
[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)
{
- return base.Equals (prefix);
+ TagPrefixInfo info = prefix as TagPrefixInfo;
+ if (info == null)
+ return false;
+
+ return (Namespace == info.Namespace
+ && Source == info.Source
+ && TagName == info.TagName
+ && TagPrefix == info.TagPrefix);
}
- [MonoTODO]
public override int GetHashCode ()
{
- return base.GetHashCode ();
+ return Namespace.GetHashCode() + Source.GetHashCode() + TagName.GetHashCode() + TagPrefix.GetHashCode();
}
[ConfigurationProperty ("assembly")]
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]; }