B
Brecht Yperman
Hi,
I've got this class which used to be xmlserializable. Now I've made it
inherit from a base class, to which' sourcecode I have no access. When I try
to serialize this class, it gives errors since several properties in the
base class are not serializable. What is the easiest way to make the
serializer ignore the properties in the base class (in my example:
Document), preferrably without changing to much in other classes (than - in
my example - Script).
e.g.:
[XmlRoot("project")]
public class Project
{
[XmlElement("script")]
public Script [] Scripts
{
get; set;
}
}
public class Script : Document
{
[XmlAttribute("version")]
public int Version { get; set; }
[XmlElement("filter")]
public Filter [] Filters { get; set; }
}
public class Filter
{
[XmlAttribute("regex")]
public string Regex { get; set; }
}
I've got this class which used to be xmlserializable. Now I've made it
inherit from a base class, to which' sourcecode I have no access. When I try
to serialize this class, it gives errors since several properties in the
base class are not serializable. What is the easiest way to make the
serializer ignore the properties in the base class (in my example:
Document), preferrably without changing to much in other classes (than - in
my example - Script).
e.g.:
[XmlRoot("project")]
public class Project
{
[XmlElement("script")]
public Script [] Scripts
{
get; set;
}
}
public class Script : Document
{
[XmlAttribute("version")]
public int Version { get; set; }
[XmlElement("filter")]
public Filter [] Filters { get; set; }
}
public class Filter
{
[XmlAttribute("regex")]
public string Regex { get; set; }
}