Click here to Skip to main content
15,925,723 members
Home / Discussions / C#
   

C#

 
GeneralRe: What's wrong...? Pin
Alex Getman3-Jun-04 7:07
Alex Getman3-Jun-04 7:07 
GeneralRe: What's wrong...? Pin
Heath Stewart3-Jun-04 7:15
protectorHeath Stewart3-Jun-04 7:15 
GeneralRe: What's wrong...? Pin
Alex Getman3-Jun-04 7:40
Alex Getman3-Jun-04 7:40 
GeneralRe: What's wrong...? Pin
Heath Stewart3-Jun-04 10:11
protectorHeath Stewart3-Jun-04 10:11 
GeneralRe: What's wrong...? Pin
Alex Getman3-Jun-04 20:25
Alex Getman3-Jun-04 20:25 
GeneralRe: What's wrong...? Pin
Wackatronic4-Jun-04 1:13
Wackatronic4-Jun-04 1:13 
GeneralRe: What's wrong...? Pin
Heath Stewart4-Jun-04 3:59
protectorHeath Stewart4-Jun-04 3:59 
GeneralXml seriliazation query Pin
avneeshb3-Jun-04 6:03
avneeshb3-Jun-04 6:03 
Hi!

I am trying to use XmlSerialization in the following scenario:

1. I have a class called Test:
public class Test
{
private int someAttribute;
[XmlAttribute]
public int Att
{
get
{
return someAttribute;
}
set
{
someAttribute=value;
}
}
}

2. And a subclass:
public class SubTest
{
public string something;
}
Upon serilialization, I get the following:

<Test Att="int" />
<SubTest>
<something>string</something>
</SubTest>

As can be seen the attribute Att is not visible in the subclass. Using virtual (for the property) and overriding it, or just hiding it with 'new' also did not help. Creating a new attribute with the same name (i.e. marking it as [XmlAttribute("Att")] also creates an error. Any suggestion as to how I can have an attribute of the same name in the subclass also?

Thanks!


GeneralRe: Xml seriliazation query Pin
Heath Stewart3-Jun-04 6:17
protectorHeath Stewart3-Jun-04 6:17 
GeneralRe: Xml seriliazation query Pin
avneeshb3-Jun-04 6:43
avneeshb3-Jun-04 6:43 
GeneralRe: Xml seriliazation query Pin
Heath Stewart3-Jun-04 6:51
protectorHeath Stewart3-Jun-04 6:51 
GeneralRe: Xml seriliazation query Pin
avneeshb3-Jun-04 8:48
avneeshb3-Jun-04 8:48 
GeneralNeed help with manipulating cd drive. Pin
Admiral Ackbar3-Jun-04 6:01
Admiral Ackbar3-Jun-04 6:01 
GeneralRe: Need help with manipulating cd drive. Pin
Heath Stewart3-Jun-04 6:14
protectorHeath Stewart3-Jun-04 6:14 
GeneralRe: Need help with manipulating cd drive. Pin
Dave Kreskowiak3-Jun-04 6:15
mveDave Kreskowiak3-Jun-04 6:15 
GeneralRe: Need help with manipulating cd drive. Pin
Admiral Ackbar3-Jun-04 7:01
Admiral Ackbar3-Jun-04 7:01 
GeneralRe: Need help with manipulating cd drive. Pin
Dave Kreskowiak3-Jun-04 7:20
mveDave Kreskowiak3-Jun-04 7:20 
GeneralRe: Need help with manipulating cd drive. Pin
Admiral Ackbar3-Jun-04 8:46
Admiral Ackbar3-Jun-04 8:46 
GeneralString formatting question Pin
BrcKcc3-Jun-04 5:47
BrcKcc3-Jun-04 5:47 
GeneralRe: String formatting question Pin
Andy *M*3-Jun-04 5:52
Andy *M*3-Jun-04 5:52 
GeneralRe: String formatting question Pin
BrcKcc3-Jun-04 6:22
BrcKcc3-Jun-04 6:22 
GeneralRe: String formatting question Pin
Andy *M*3-Jun-04 6:28
Andy *M*3-Jun-04 6:28 
GeneralSharing a config file Pin
Andy *M*3-Jun-04 5:22
Andy *M*3-Jun-04 5:22 
GeneralRe: Sharing a config file Pin
Dave Kreskowiak3-Jun-04 5:55
mveDave Kreskowiak3-Jun-04 5:55 
GeneralRe: Sharing a config file Pin
Heath Stewart3-Jun-04 6:07
protectorHeath Stewart3-Jun-04 6:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.