I am implementing a class object that is serializable.
something like this:
StringWriter sw = new StringWriter();
XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
ns.Add("", "");
System.Xml.Serialization.XmlSerializer x =
new System.Xml.Serialization.XmlSerializer(this.GetType());
x.Serialize(sw, this,ns);
return sw.ToString();
I want the child class/objects to have different names depending on a flag. is there a ways to change the ElementName of the class prop. during run time without write a custom WriteXml?