Can Anyone Write myXmlDocument class that inherits from XmlDocument ?

  • Thread starter Thread starter Ozz
  • Start date Start date
O

Ozz

public class myXmlDocument:XmlDocument
{
public class myXmlDocument(XmlDocument x)
{
this=x;
}

}

"ITS WRONG ONE" (look above)

I will write:

XmlDocument x1=new XmlDocument();
x1.LoadXml("<a/>");
myXmlDocument x=new myXmlDocument(x1) ;
----> this line creates instance from myXmlDocument and set itself
(instance) to x1;

in summary can i set instance to something in constructor or method of
class...?

its possible ...

How XmlDataDocument make it ???????
XmlDataDocument x=new XmlDataDocument (DataSet myDataSet);
 
I want to extend XmlDocument class as microsoft's --XmlDataDocument---
I want special XmlDocument that has application spesific extension
(methods,attributes,cons..)
Because of that I have to inherit Framework's XmlDocument class...

public class XmlMyDocument:XmlDocument
{
public void MyMethod1(){....}
public void MyMethod2(){....}
public XlmMyDocument(.....){}
.......
......
}

but i couldnt set my instance like that XmlMyDocument xx=new
XmlMyDocument(MyDataSet)

Microsoft's XmlDataDocument made it i know but i couldnt make by code ...
Because i couldnt set instance like below...


public class XmlMyDocument:XmlDocument
{
public void MyMethod1(){....}
public void MyMethod2(){....}
public XlmMyDocument(yyyyyy)
{
this=...........

}

}

yyyyyyy is maybe dataset maybe another thing ..Not only constructor but also
anywhere in class , i couldnt access instance's itself by "this"...Compiler
said to me its readonly how can i make my this scenerio ..

Note: I know that i can make it another ways
(
*factory method
*writing non-inherited class that has XmlDocument element (property)
)
But i think regular way is i couldnt make ...



XmlDataDocument has special method farkli olarak
 
Back
Top