Merge pull request #3962 from mkorkalo/fix_MonoBtlsContext_memory_leak
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / TransformerInfo.cs
index 02115933a27b364cb7091ca2396c905e5df9bb01..d19b61d42f40c01f9ac9018912db0c00153b41d3 100644 (file)
@@ -30,9 +30,9 @@
 
 
 using System;
+using System.ComponentModel;
 using System.Configuration;
 
-#if NET_2_0
 
 namespace System.Web.Configuration {
 
@@ -44,8 +44,14 @@ 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);
@@ -58,16 +64,15 @@ namespace System.Web.Configuration {
                        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)]
@@ -84,7 +89,7 @@ namespace System.Web.Configuration {
                        set { base[typeProp] = value; }
                }
 
-               protected override ConfigurationPropertyCollection Properties {
+               protected internal override ConfigurationPropertyCollection Properties {
                        get { return properties; }
                }
 
@@ -92,5 +97,4 @@ namespace System.Web.Configuration {
 
 }
 
-#endif