Beispiel #1
0
 public static void SaveAll()
 {
     XmlSerializer serializer = new XmlSerializer(typeof(PlaylistsFile));
     var pFile = new PlaylistsFile();
     pFile.Playlists = new List<Playlist>(Data);
     const string path = "Playlists.xml";
     if (File.Exists(path))
         File.Delete(path);
     var stream = File.OpenWrite(path);
     serializer.Serialize(stream, pFile);
     stream.Close();
 }
Beispiel #2
0
        public static void SaveAll()
        {
            XmlSerializer serializer = new XmlSerializer(typeof(PlaylistsFile));
            var           pFile      = new PlaylistsFile();

            pFile.Playlists = new List <Playlist>(Data);
            const string path = "Playlists.xml";

            if (File.Exists(path))
            {
                File.Delete(path);
            }
            var stream = File.OpenWrite(path);

            serializer.Serialize(stream, pFile);
            stream.Close();
        }