Example #1
0
 public void ReadFile(string fileName)
 {
     using (var reader = new StreamReader(fileName))
     {
         Store = (XMLSchool)_serializer.Deserialize(reader);
     }
 }
Example #2
0
 public XMLFileHandler()
 {
     Store = new XMLSchool();
     // Please refer to the XMLDataStuctures class file to see how the xml tree is constructed.
     // Once an object representing the tree is properly constructed, .NET XMLSerializers map the information from the xml to the object accordingly.
     _serializer = new XmlSerializer(typeof(XMLSchool));
     _ns = new XmlSerializerNamespaces();
     _ns.Add(string.Empty, string.Empty);
 }