Hey all
I've developed a couple of strongly-typed collections and marked them as
[Serializable], however when I attempt to serialize instances of the
collection I recieve the following exception:
"You must implement the Add(System.Object) method on
PrecisionObjects.Collections.Specialized.StringDictionaryEx because it
inherits from IEnumerable."
Short of implementing the IXmlSerializable interface, which is intended for
internal use of the .NET Framework, is there a way I can get Xml
Serialization to work?
Implementing the Add(System.Object) method as below:
public void Add(object value)
{
if(value is DictionaryEntry)
{
DictionaryEntry entry = (DictionaryEntry) value;
if(entry.Key is string && entry.Value is string)
{
this.Add(entry.Key as string, entry.Value as string);
}
}
}
Still produced the same exception...
Thanks in advance
Doug Holland
|