Exemple #1
0
        public static Preset LoadPreset(string path)
        {
            Stream    stream = PresetManager.OpenPresetFile(path, FileMode.Open, FileAccess.Read);
            XmlReader reader = new XmlTextReader(stream);
            Preset    preset = new Preset(Path.GetFileNameWithoutExtension(path));

            ReadPreset(reader, preset);
            reader.Close();
            return(preset);
        }
Exemple #2
0
        public static void SavePreset(Preset preset)
        {
            string    path   = string.Format("{0}.xml", preset.Name);
            Stream    stream = PresetManager.OpenPresetFile(path, FileMode.Create, FileAccess.ReadWrite);
            XmlWriter writer = new XmlTextWriter(stream, UTF8Encoding.UTF8);

            WritePreset(writer, preset);
            writer.Flush();
            writer.Close();
        }