473,322 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 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 1007

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Nick Zdunic | last post by:
I have a remotable object running in my host application. The host starts up and creates the object. Within a method to start the remote object doing its thing it creates an object. ...
6
by: Mike Guerrieri | last post by:
I have a few objects that I've created, Contact, Address, AddressCollection (inherits from CollectionBase), dtaContact, and dtaAddress. One of the properties of the Contact object...
0
by: Rein Petersen | last post by:
Hi All, I've been searching around for a solution to over-riding the default serialization of an object whose class is derived from System.Collections.CollectionBase (implementing ICollection)....
2
by: onedaywhen | last post by:
Does anyone know of a good .NET article, sample, etc to demonstrate creating an object model, one where you have one externally creatable object with a hierarchy of dependent objects? For example,...
2
by: Ian Gore | last post by:
Hi, I'm relatively new to VB.NET so I'd be grateful if someone could point out what I don't understand here... 1) Creating a strongly typed collection by inheriting CollectionBase. This is...
0
by: John Manion via .NET 247 | last post by:
Long Post, thanks for your patience... I have and XML file that looks something like this: <?xml version="1.0" encoding="utf-8" ?> <Settings> <Location> <X>30</X> <Y>40</Y> </Location>...
2
by: bughunter | last post by:
This is partly 'for the record' and partly a query about whether the following is a bug somewhere in .Net (whether it be the CLR, JITter, C# compiler). This is all in the context of .Net 1.1 SP1. ...
6
by: Amber | last post by:
do the following steps: 1:Use Manage Studio login the server with Integrated security. 2:Create a dabase named testdb; 3:Create a SQL Server login named amber ,and set it to be dbowner of...
0
by: nmaddock | last post by:
Hi Guys, seen this example on msdn, how can i remove the invalide nodes and elements when they fail against the schema and then save to a new xml document. any help would be great my code is...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.