Class inheritance issue with XmlNodeList
-
Hello, I am attempting to create a custom class that is inherited from XmlNodeList. public class MyNLClass : XmlNodeList { public string MyFunction(string name) { } } I would like to add a few additional functions. when I create class, I am getting errors like: MyNLClass' does not implement inherited abstract member 'System.Xml.XmlNodeList.Count.get' MyNLClass' does not implement inherited abstract member 'System.Xml.XmlNodeList.GetEnumerator()' MyNLClass' does not implement inherited abstract member 'System.Xml.XmlNodeList.Item(int)' Any help would be appreciated. Thanks
-
Hello, I am attempting to create a custom class that is inherited from XmlNodeList. public class MyNLClass : XmlNodeList { public string MyFunction(string name) { } } I would like to add a few additional functions. when I create class, I am getting errors like: MyNLClass' does not implement inherited abstract member 'System.Xml.XmlNodeList.Count.get' MyNLClass' does not implement inherited abstract member 'System.Xml.XmlNodeList.GetEnumerator()' MyNLClass' does not implement inherited abstract member 'System.Xml.XmlNodeList.Item(int)' Any help would be appreciated. Thanks
The XmlNodeClass is cannot be created. Notice that the constructor is protected. Therefore this class was meant to be inherited from. Basically the class is essentially abstract and so are the members for which you are receiving errors. Therefore, if you inherit from this class, you must implement all methods and properties that are abstract on this class. ie you must define these methods in your class. That is why you are getting the above errors. It's complaining that you haven't implemented them.