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
2 Answers
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.
Easiest way to find out is to look if it implements IDisposable
-
1And, the easiest way to do that is with 'Go To Definition', 'Object Browser' or Reflector– BertvanSep 9, 2010 at 20:28
-
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. Sep 9, 2010 at 20:42