Inheriting from XmlElement

V

Varangian

Hello

something I want to ask...... why on earth you cannot inherit from
XmlElement???? .... or you can but XmlElement constructor is protected
or private and so you cannot define an empty constructor. Even when I
tried building a constructor with the exact parameters like XmlElement
it wouldn't work!!!!

"Error 1 No overload for method 'XmlElement' takes '0' arguments"

Any workarounds or ideas?
 
M

Marc Gravell

Can we take a step back? *why* do you want to inherit from XmlElement?
What are you trying to do? As this will steer the most appropriate
workaround.

For reference, you can IIRC inherit from XmlNode (can be used to
provide some fun late xml serialization wossits under WSE etc)

Marc
 
V

Varangian

Can we take a step back? *why* do you want to inherit from XmlElement?
What are you trying to do? As this will steer the most appropriate
workaround.

For reference, you can IIRC inherit from XmlNode (can be used to
provide some fun late xml serialization wossits under WSE etc)

Marc

Hello Marc Gravell

basically I making some design to sort making a strongly typed
collection of XmlElements to be used in an XmlDocument.... I have
about 5 classes each inheriting from XmlElement....
 
M

Marc Gravell

Have you tried using the non-default base ctor?

public class TestElement : XmlElement {
public TestElement(string prefix, string localName, string
namespaceUri, XmlDocument doc)
: base(prefix, localName, namespaceUri, doc) {

}
}

Marc
 
V

Varangian

Have you tried using the non-default base ctor?

public class TestElement : XmlElement {
public TestElement(string prefix, string localName, string
namespaceUri, XmlDocument doc)
: base(prefix, localName, namespaceUri, doc) {

}

}

Marc

yes it worked thanks very much you rock!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top