|
-
Apr 23rd, 2005, 07:49 AM
#1
Thread Starter
Frenzied Member
Serializing Collections with Additional Properties
I just recently started playing with XML and the XML Serializer class. However, when serializing certain classes I encountered some strange results.
If I create a strongly typed collection and serialize it, it works perfectly fine, no problems there, the problem arises when I want to add an extra property to the collection class, such as Name or something. This extra property obviously can't be an element inside a collection class, however, I'm unable to make it an attribute either.
Is it possible to have a collection class that has some additional properties that can be used to like distinguish that instance from another like a Name property, have the additional properties serialized as attributes of that collection?
If not, what's the best way of doing it? Because I also put collections inside collections, hence why I add these extra properties to the collection, because it's the most logical place to put them.
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|