Example #1
0
        private void MenuItem_OpenPlayList(object sender, RoutedEventArgs e)
        {
            string     PlayListName = (sender as MenuItem).Header.ToString();
            VideoClass VideoToPlay  = PlaylistProvider.Load(PlayListName);

            PlayVideo(new Uri(VideoToPlay.Path));
            RenderNextAndPrevious();
            PlayingInfo.Header = "Playing: " + PlayListName + " [1/" + PlaylistProvider.CurrentPlaylist.Count + "]";
        }
        public void AddToPlayList(string PlaylistName, string VideoPath)
        {
            VideoClass video = new VideoClass()
            {
                Path = VideoPath
            };

            string PlayListPath = PlayListsPaths + PlaylistName + ".csv";

            // read from playlist from csv
            List <VideoClass> videoList = Convertor.Read <VideoClass>(PlayListPath);

            videoList.Add(video);

            // save playlist to csv file
            Convertor.Write(PlayListPath, videoList);
        }
        public void CreateNew(string PlaylistName, string VideoPath)
        {
            VideoClass video = new VideoClass()
            {
                Path = VideoPath
            };

            CurrentPlaylistName = PlaylistName;

            string PlayListPath = PlayListsPaths + PlaylistName + ".csv";

            // save playlist to csv file
            Convertor.Write(PlayListPath, new List <VideoClass>()
            {
                video
            });
        }