473,397 Members | 1,961 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,397 software developers and data experts.

Generics and attributes

I'm playing a little bit with 2.0 and generics.

I have two classes

public class UserCollection : Collection<User>
{
}

public class User
{
public string Name;
}

Serializing this collection with XmlSerializer brings me

<UserCollection>
<User>
<Name/>
</User>
</UserCollection>

With the attribute [XmlRoot("Users")] in front of the collection I can
modify the "UserCollection"-Tag to "Users".

But how do I modify the "User"-Tag? From 1.1 I know to somewhere put a
[XmlArrayItem("MyUser")], but where to put it in 2.0? In front of User
it doesn't work.

--
Sleepless in Berlin
W. Schwenkner
Nov 16 '05 #1
0 918

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

Similar topics

4
by: Brian | last post by:
Hi, According to An Introduction to C# Generics (http://www.msdn.microsoft.com/vcsharp/default.aspx? pull=/library/en-us/dv_vstechart/html/csharp_generics.asp) the AttributeUsage enumeration...
3
by: Pierre Y. | last post by:
Hi, I've just read that article : http://msdn.microsoft.com/library/en-us/dnvs05/html/csharp_generics.asp I'm asking something. Why are generics constraints not been implemented using...
2
by: Ricebot | last post by:
Hi, I'm playing around with extended List<T> such that I have a generic list collection that is cloneable (fully, not shallow) and serializable. So far the impl looks like this. using...
10
by: lpinho | last post by:
Hi all, I have a class (named for the example myObject) that can be of several types (int, string, float, etc), instead of using a object to define it's type I used a generic. public class...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.