Ejemplo n.º 1
0
        /// <summary>
        /// Saves the XML document.
        /// </summary>
        public static void SaveXml()
        {
            using (XmlWriter writer = XmlWriter.Create(Paths.CreateOSPath("settings.xml"), XmlWriterSettings))
            {
                writer.WriteStartDocument();
                writer.WriteStartElement("Options");

                writer.WriteStartElement("General");

                writer.WriteElementString("AutoSave", AutoSave.ToString());
                writer.WriteElementString("AutoSaveSpeed", AutoSaveSpeed.ToString());
                writer.WriteElementString("AutoScroll", AutoScroll.ToString());
                writer.WriteElementString("Music", Music.ToString());
                writer.WriteElementString("NpcBar", NpcBar.ToString());
                writer.WriteElementString("NpcDamage", NpcDamage.ToString());
                writer.WriteElementString("NpcName", NpcName.ToString());
                writer.WriteElementString("PlayerBar", PlayerBar.ToString());
                writer.WriteElementString("PlayerDamage", PlayerDamage.ToString());
                writer.WriteElementString("PlayerName", PlayerName.ToString());
                writer.WriteElementString("SavedAccount", SavedAccount);
                writer.WriteElementString("SavedPassword", SavedPassword);
                writer.WriteElementString("Sound", Sound.ToString());
                writer.WriteElementString("SpeechBubbles", SpeechBubbles.ToString());
                writer.WriteElementString("Timestamps", Timestamps.ToString());
                writer.WriteElementString("ActiveSkin", ActiveSkin);
                writer.WriteElementString("LastClientUpdateTime", LastClientUpdateTime.ToBinary().ToString());
                writer.WriteElementString("LastGFXUpdateTime", LastGFXUpdateTime.ToBinary().ToString());

                writer.WriteEndElement();
                writer.WriteStartElement("ConnectionInfo");

                writer.WriteElementString("Port", ConnectionPort.ToString());
                writer.WriteElementString("Server", ConnectionIP);
                writer.WriteElementString("UpdateLink", UpdateAddress);
                writer.WriteElementString("SFXLink", SoundAddress);
                writer.WriteElementString("MusicLink", MusicAddress);

                writer.WriteEndElement();
                writer.WriteStartElement("Editor");

                writer.WriteElementString("MapGrid", MapGrid.ToString());
                writer.WriteElementString("DisplayAttributes", DisplayAttributes.ToString());
                writer.WriteElementString("DragAndPlace", DragAndPlace.ToString());

                writer.WriteEndElement();

                writer.WriteEndElement();
                writer.WriteEndDocument();
            }
        }