// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
using System;
+using System.ComponentModel;
using System.Configuration;
using System.Xml;
static TagMapInfo ()
{
- mappedTagTypeProp = new ConfigurationProperty ("mappedTagType", typeof (string));
- tagTypeProp = new ConfigurationProperty ("tagType", typeof (string), "", ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
+ mappedTagTypeProp = new ConfigurationProperty ("mappedTagType", typeof (string), null,
+ TypeDescriptor.GetConverter (typeof (string)),
+ PropertyHelper.NonEmptyStringValidator,
+ ConfigurationPropertyOptions.None);
+ tagTypeProp = new ConfigurationProperty ("tagType", typeof (string), "",
+ TypeDescriptor.GetConverter (typeof (string)),
+ PropertyHelper.NonEmptyStringValidator,
+ ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
properties = new ConfigurationPropertyCollection ();
properties.Add (mappedTagTypeProp);
properties.Add (tagTypeProp);
}
+ internal TagMapInfo ()
+ {
+ }
+
public TagMapInfo (string tagTypeName, string mappedTagTypeName)
{
this.TagType = tagTypeName;
this.MappedTagType = mappedTagTypeName;
}
- [MonoTODO]
- public override bool Equals (object map)
+ public override bool Equals (object o)
{
- return base.Equals (map);
+ TagMapInfo info = o as TagMapInfo;
+ if (info == null)
+ return false;
+
+ return (MappedTagType == info.MappedTagType
+ && TagType == info.TagType);
}
- [MonoTODO]
- protected override bool SerializeElement (XmlWriter writer, bool serializeCollectionKey)
+ public override int GetHashCode ()
{
- return base.SerializeElement (writer, serializeCollectionKey);
+ return MappedTagType.GetHashCode() + TagType.GetHashCode();
}
- [MonoTODO]
- public override int GetHashCode ()
+ protected internal override bool SerializeElement (XmlWriter writer, bool serializeCollectionKey)
{
- return base.GetHashCode ();
+ bool ret = base.SerializeElement (writer, serializeCollectionKey);
+
+ /* XXX more here? .. */
+
+ return ret;
}
[StringValidator (MinLength = 1)]
set { base[tagTypeProp] = value; }
}
- protected override ConfigurationPropertyCollection Properties {
+ protected internal override ConfigurationPropertyCollection Properties {
get { return properties; }
}
}
}
-#endif