Пример #1
0
        public static PlaylistSave3 ConvertFrom(PlaylistSave2 p2)
        {
            var p3 = new PlaylistSave3();

            p3.Version = CurrentVersion;
            foreach (var item in p2.Items)
            {
                var item3 = new PlaylistItemSave3();
                item3.Set(item.Title, item.AlbumName, item.ArtistName, "", item.PathName, item.CueSheetIndex, item.StartTick, item.EndTick, item.ReadSeparaterAfter, -1, 0);
                p3.items.Add(item3);
            }
            return(p3);
        }
Пример #2
0
        public static PlaylistSave2 ConvertFrom(PlaylistSave p1)
        {
            var p2 = new PlaylistSave2();

            p2.Version = CurrentVersion;
            foreach (var item in p1.Items)
            {
                var item2 = new PlaylistItemSave2();
                item2.Set(item.Title, item.AlbumName, item.ArtistName, item.PathName, item.CueSheetIndex, item.StartTick, item.EndTick, item.ReadSeparaterAfter, -1, 0);
                p2.items.Add(item2);
            }
            return(p2);
        }
Пример #3
0
        public static PlaylistSave3 LoadFrom(string path, bool useIsolatedStorage = false)
        {
            var           xmlRW3 = new WWXmlRW.XmlRW <PlaylistSave3>(path, useIsolatedStorage);
            PlaylistSave3 p3     = xmlRW3.Load();

            if (p3.ItemNum == 0)
            {
                var           xmlRW2 = new WWXmlRW.XmlRW <PlaylistSave2>(path, useIsolatedStorage);
                PlaylistSave2 p2     = xmlRW2.Load();
                if (p2.ItemNum == 0)
                {
                    var xmlRW1 = new WWXmlRW.XmlRW <PlaylistSave>(path, useIsolatedStorage);
                    var p1     = xmlRW1.Load();
                    p2 = PlaylistSave2.ConvertFrom(p1);
                }
                p3 = PlaylistSave3.ConvertFrom(p2);
            }
            OverwritePlaylist(p3);

            return(p3);
        }