Exemplo n.º 1
0
        public static void Save(LevelEditorOptions options, FileInfo file = null)
        {
            options = options ?? Instance;
            file = file ?? FileDefault;

            if (file.Exists) {
                file.Delete();
            }

            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.AppendChild(options.Serialize(xmlDocument));

            FileStream fos = new FileStream(file.FullName, FileMode.CreateNew);
            XmlWriterSettings xmlWriterSettings = new XmlWriterSettings();
            xmlWriterSettings.Indent = true;
            XmlWriter xmlWriter = XmlWriter.Create(fos, xmlWriterSettings);
            xmlDocument.Save(xmlWriter);
            xmlWriter.Close();
            fos.Close();
        }
Exemplo n.º 2
0
 public static void Initialize()
 {
     Instance = Load();
 }