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
"Cowboy (Gregory A. Beamer)" <(E-Mail Removed)> wrote in
message news:epRDM%(E-Mail Removed)...
> It really depends on the constructor available. But, I do not see a lot of
> value in your methodology, as you can copy/clone many object to create a
new
> one. The only real savings from a constructor that allows you to feed the
> same type of object is the ability to accomplish the task with less
typing.
> If you are trying to alter a doc, you can clone and work with either the
> copy or the original and use the other to revert back, if necessary.
>
> To save typing, you can create a factory object (typing in the working
> class, not in the factory, of course). With static methods, you could
have:
>
> XmlDocument myXmlDoc = XmlFactory.CreateXMLDoc(xmlDoc);
>
> Am I on track with what you are asking?
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> Author: ADO.NET and XML: ASP.NET on the Edge
>
>
****************************************************************************
> ****
> Think Outside the Box!
>
****************************************************************************
> ****
> "Ozz" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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);
> >
> >
> >
>
>
|