I've got some code generated from an XSD, one of the properties is an array that can be one of 7 different classes, all these classes share some fields so I would like to create an interface so I can iterate over the array and access the 'tpl' property without having to do a huge switch statement and casting.
I've done this manually for now just for the 'tpl' property but I was wondering if there was a tool or way to paste all the classes into something and it would identify the common properties and generate an interface for me?
My Google fu is only comming up with things that will extract an interface from a single class or keep a class and interface in sync.
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("DT", typeof(DT2))]
[System.Xml.Serialization.XmlElementAttribute("IP", typeof(IP2))]
[System.Xml.Serialization.XmlElementAttribute("OPDT", typeof(OPDT2))]
[System.Xml.Serialization.XmlElementAttribute("OPIP", typeof(OPIP2))]
[System.Xml.Serialization.XmlElementAttribute("OPOR", typeof(OPOR2))]
[System.Xml.Serialization.XmlElementAttribute("OR", typeof(OR2))]
[System.Xml.Serialization.XmlElementAttribute("PP", typeof(PP2))]
public object[] Items {
get {
return this.itemsField;
}
set {
this.itemsField = value;
}
}