// This really should only be used for development. Included for completeness.
 public static void DumpXML(string fileName, PlayfieldInfo pfInfo)
 {
     XmlSerializer serializer = new XmlSerializer(typeof(List<DistrictInfo>), new XmlRootAttribute("Districts"));
     XmlSerializerNamespaces xsn = new XmlSerializerNamespaces();
     xsn.Add(String.Empty, String.Empty);
     MemoryStream stream = new MemoryStream();
     serializer.Serialize(stream, pfInfo.districts, xsn);
     XmlDocument xmlDoc = new XmlDocument();
     xmlDoc.LoadXml(Encoding.ASCII.GetString(stream.GetBuffer()));
     stream.Dispose();
     xmlDoc.DocumentElement.SetAttribute("Playfield", pfInfo.id.ToString());
     xmlDoc.Save(fileName);
 }
Exemple #2
0
        // This really should only be used for development. Included for completeness.
        public static void DumpXML(string fileName, PlayfieldInfo pfInfo)
        {
            XmlSerializer           serializer = new XmlSerializer(typeof(List <DistrictInfo>), new XmlRootAttribute("Districts"));
            XmlSerializerNamespaces xsn        = new XmlSerializerNamespaces();

            xsn.Add(String.Empty, String.Empty);
            MemoryStream stream = new MemoryStream();

            serializer.Serialize(stream, pfInfo.districts, xsn);
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.LoadXml(Encoding.ASCII.GetString(stream.GetBuffer()));
            stream.Dispose();
            xmlDoc.DocumentElement.SetAttribute("Playfield", pfInfo.id.ToString());
            xmlDoc.Save(fileName);
        }