using System;
+using System.ComponentModel;
using System.Configuration;
-#if NET_2_0
namespace System.Web.Configuration {
static TransformerInfo ()
{
- nameProp = new ConfigurationProperty ("name", typeof (string), "", ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
- typeProp = new ConfigurationProperty ("type", typeof (string), "", ConfigurationPropertyOptions.IsRequired);
+ nameProp = new ConfigurationProperty ("name", typeof (string), "",
+ TypeDescriptor.GetConverter (typeof (string)),
+ PropertyHelper.NonEmptyStringValidator,
+ ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
+ typeProp = new ConfigurationProperty ("type", typeof (string), "",
+ TypeDescriptor.GetConverter (typeof (string)),
+ PropertyHelper.NonEmptyStringValidator,
+ ConfigurationPropertyOptions.IsRequired);
properties = new ConfigurationPropertyCollection ();
properties.Add (nameProp);
this.Type = type;
}
- [MonoTODO]
- public bool Equals (object o)
+ public override bool Equals (object o)
{
- return base.Equals (o);
+ TransformerInfo info = o as TransformerInfo;
+ return (Name == info.Name && Type == info.Type);
}
- [MonoTODO]
- public int GetHashCode ()
+ public override int GetHashCode ()
{
- return base.GetHashCode ();
+ return Name.GetHashCode () + Type.GetHashCode ();
}
[StringValidator (MinLength = 1)]
set { base[typeProp] = value; }
}
- protected override ConfigurationPropertyCollection Properties {
+ protected internal override ConfigurationPropertyCollection Properties {
get { return properties; }
}
}
-#endif