/// <summary>
 /// </summary>
 /// <param name="fileName">
 /// </param>
 /// <param name="pfInfo">
 /// </param>
 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);
 }
Beispiel #2
0
        /// <summary>
        /// </summary>
        /// <param name="fileName">
        /// </param>
        /// <param name="pfInfo">
        /// </param>
        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);
        }