views:

28

answers:

2

I can't find any info about whether or not I should dispose/close this object after using it... Here is the msdn link: http://msdn.microsoft.com/en-us/library/bb343181.aspx

+3  A: 

Easiest way to find out is to look if it implements IDisposable

Bertvan
And, the easiest way to do that is with 'Go To Definition', 'Object Browser' or Reflector
Bertvan
And of course, as Andrew said, the answer is No :)
Bertvan
Sure, that's a good/simple way to do this... I really couldn't find a dispose of close method, so I'm under the assumption that like Andrew said, this is really handled by the XDocument class it self. Thanks for your quick answer.
Wagner Danda da Silva
+4  A: 

No, you don't - it doesn't even implement IDisposable. The XDocument and XElement classes use XmlReader under the covers and handle the disposing of the underlying reader for you.

Andrew Hare