PC Review


Reply
Thread Tools Rate Thread

Can Anyone Write myXmlDocument class that inherits from XmlDocument ?

 
 
Ozz
Guest
Posts: n/a
 
      7th Aug 2003
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);



 
Reply With Quote
 
 
 
 
Ozz
Guest
Posts: n/a
 
      7th Aug 2003
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);
> >
> >
> >

>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). murl Microsoft ASP .NET 0 27th Mar 2007 10:30 PM
How to export a class that inherits from unmanaged exception class Bob Altman Microsoft VC .NET 3 17th Oct 2006 08:49 PM
inherit from class which inherits from Page class djus@poczta.onet.pl Microsoft ASP .NET 0 14th Jul 2004 01:17 PM
Pass an instantiated base class to a new class that inherits the same class -- Possible?? Brad Navarro Microsoft C# .NET 3 9th Jan 2004 01:07 AM
inheriting from a class that inherits from the UserControl class Joel Barsotti Microsoft ASP .NET 4 30th Oct 2003 08:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:26 PM.