XmlTextReader object copying

L

lucoto

Hi,
Can anyone explain me how to copy a XmlTextReader object instead of
copying a reference to it? I tried to use MemberwiseClone() method but
it doesn't make a deep-copy as well.. and ICloneable interface is not
inherited by XmlTextReader class. Hopefully there are some other ways
to do it but I'm quite new to c# programming so any advice will be
helpful :)

Thanks in advance,
Greetings,
Lukasz
 
J

Jon Skeet [C# MVP]

Can anyone explain me how to copy a XmlTextReader object instead of
copying a reference to it? I tried to use MemberwiseClone() method but
it doesn't make a deep-copy as well.. and ICloneable interface is not
inherited by XmlTextReader class. Hopefully there are some other ways
to do it but I'm quite new to c# programming so any advice will be
helpful :)

Could you explain a little bit about what you actually want to achieve?
Normally I'd just suggest creating two XmlTextReaders from the same
source data, but it really depends on what you want to do.

Jon
 
J

Jon Skeet [C# MVP]

Vincent said:
Why would you want to have two XmlTextReaders on the same data?

I could imagine situations where the data might have two lists that you
want to work through in parallel, or something similar. I guess we'll
have to wait to see what the OP is really after though...

Jon
 
V

Vincent

Good point, more than one way to do everything.
I could imagine situations where the data might have two lists that you
want to work through in parallel, or something similar. I guess we'll
have to wait to see what the OP is really after though...

Jon
 

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