I have :
public class Test
{
[XmlAttribute("id")]
public int id;
public Test(){}
/*...*/
}
public class Subclass : Test
{
public Subclass(){}
/*..*/
}
public class Subclass1: Test
{
public Subclass1(){}
/*..*/
}
Suppose I have a table of Test objects. I want serialize it but I want also
objects of class Subclass have attribute id, but objects of class Subclass1
don't.
The code :
XmlAttributes attrs = new XmlAttributes();
attrs.XmlIgnore = true;
XmlAttributeOverrides overrides = new XmlAttributeOverrides();
overrides.Add( typeof(Subclass1),"id", attrs );
doesn't work. I think it doesn't work because class Subclass1 actually has
no "id" member - it's in the parent (Test) class.
Please help.
--
WielO
mailto:[EMAIL PROTECTED]
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.