PC Review


Reply
Thread Tools Rate Thread

Collection Xml Serialization

 
 
=?Utf-8?B?RG91ZyBIb2xsYW5k?=
Guest
Posts: n/a
 
      2nd Mar 2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Serialization of a custom collection TarTar Microsoft C# .NET 3 29th Jan 2009 09:19 PM
XML Serialization and Generic Collection Mirek Endys Microsoft C# .NET 3 24th Feb 2006 02:57 AM
Serialization of collection Shane Story Microsoft VB .NET 1 15th Jun 2005 04:18 AM
Serialization of non-Serialized collection Tamir Khason Microsoft C# .NET 1 28th Oct 2004 09:02 PM
XML Serialization of custom collection =?Utf-8?B?amFtaWVfbV8=?= Microsoft VB .NET 1 5th Mar 2004 09:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:51 PM.