I am doing the exact same thing in two classes, and in one the compiler is allowing it just fine, but the other one is giving me an error. Why the double standard? There's 15 classes using this same pattern, but only one refuses to compile, saying the following error:
'AWWAInvoicingXML.AwwaTransmissionInfo' does not implement interface member 'AWWAInvoicingXML.IXmlSerializable.fromXML(System.Xml.XmlDocumentFragment)'. 'AWWAInvoicingXML.AwwaTransmissionInfo.fromXML(System.Xml.XmlDocumentFragment)' is either static, not public, or has the wrong return type.
Here is my source code... if I comment out the AwwaTransmissionInfo class, the rest of the file compiles just fine, so I know it's not one of those where the compiler is just dying after the first error. And I know, I know, there's built-in stuff for what I'm trying to do here, but just assume I actually know what I'm doing and skipped the built-in serializers for a reason :)
public interface IXmlSerializable {
//if this interface is implemented, the object can be serialized to XML
string toXML();
IXmlSerializable fromXML(XmlDocumentFragment inXml);
}
public class AwwaTransmissionInfo : IXmlSerializable {
public DateTime DateTime = DateTime.Now;
public int ItemCount;
public string toXML() {
throw new Exception("The method or operation is not implemented.");
}
public AwwaTransmissionInfo fromXML(XmlDocumentFragment inXml) {
throw new Exception("The method or operation is not implemented.");
}
}
public class CEmail {
public string Email = "";
public string toXML() {
throw new System.Exception("The method or operation is not implemented.");
}
public CEmail fromXML(XmlDocumentFragment inXml) {
throw new System.Exception("The method or operation is not implemented.");
}
}