471,056 Members | 1,603 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,056 software developers and data experts.

Schema for an object inherits from CollectionBase

Hi,

I'm trying to create the schema (XSD) for a class that inherites from
System.Collections.CollectionBase, and indicate the ElementName of the
root and every item. This is an example:

[XmlRoot("list")]
public class MyList : System.Collections.CollectionBase
{
(...)
public MyListItem this[int index]
{
get { return this.List[index] }
set { this.List[index] = value; }
}
(...)
}

And I want an xml like this:

<list>
<listItem></listItem>
</list>

But I get the following:

<list>
<MyListItem></MyListItem>
</list>

How can I give a specific name to the items of the collection (I need
to inherite from CollectionBase, that isn't negotiable ;-))?

Thanks a lot in advance,

Marc.

Aug 30 '06 #1
0 930

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Nick Zdunic | last post: by
6 posts views Thread by Mike Guerrieri | last post: by
2 posts views Thread by onedaywhen | last post: by
reply views Thread by John Manion via .NET 247 | last post: by
2 posts views Thread by bughunter | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.