I am reading some Microsoft documentation on XmlReader. The documentation is great, however I am looking for an explanation as to why they choose to implement the
use of a using statement at line 1? I read the documentation on the "using" statement, and it seems to be geared twords when you are using IDisposable:
Does XmlReader implement the IDisposable object? If I had to explain to someone else why a using statement is used at line 1 below, I really could not do it. Perhaps someone can help me to understand.
// Create an XmlReader
1 using (XmlReader reader = XmlReader.Create(new StringReader(xmlString)))
5 string genre = reader.Value;
6 output.AppendLine("The genre value: " + genre);
of the title element: " + reader.ReadElementContentA