Exemplo n.º 1
0
        private void Go_Button_Click(object sender, RoutedEventArgs e)
        {
            PlayListObj selctedPlaylistName = (PlayListObj)PlayListCombo.SelectedItem;

            System.Diagnostics.Debug.WriteLine("selctedPlaylistName------::", selctedPlaylistName.PlayListNameWithExtn);
            Frame.Navigate(typeof(PlayList), selctedPlaylistName.PlayListNameWithExtn);
        }
Exemplo n.º 2
0
        //New as of 6/7 from slack.
        private async void getSongsListFromFile(string PlayListFileName)
        {
            try
            {
                var playListFolder = await KnownFolders.DocumentsLibrary.CreateFolderAsync(MY_PLAYLIST_FOLDER, CreationCollisionOption.OpenIfExists);

                System.Diagnostics.Debug.WriteLine(" PlayList XAML.  getSongsListFromFile  PlayListFileName ----------------- \n", PlayListFileName);
                var playListFile = await playListFolder.GetFileAsync(PlayListFileName.Trim());

                var stream = await playListFile.OpenStreamForReadAsync();

                Songs song = new Songs();

                using (var reader = new StreamReader(stream))
                {
                    string line;
                    int    linecounter = 0;

                    while ((line = reader.ReadLine()) != null)
                    {
                        System.Diagnostics.Debug.WriteLine(" PlayList XAML.CS Line----------------- {0}\n", line);
                        var lineArray = line.Split(',');
                        if (linecounter.Equals(0)) //Zeroth position line has
                        {
                            playListObj = new PlayListObj
                            {
                                FileName             = lineArray[0],
                                PlayListNameWithExtn = lineArray[1],
                                ImageName            = lineArray[2],
                                ImagePath            = lineArray[3]
                            };
                            linecounter++;
                        }
                        else
                        {
                            song = new Songs
                            {
                                Title             = lineArray[0],
                                TitleWithFileExtn = lineArray[1],
                                FilePath          = lineArray[2],
                                Album             = lineArray[3],
                                Artist            = lineArray[4]
                            };
                            Songslist.Add(song);
                            linecounter++;
                        }
                    }
                }
            }
            catch (Exception exp)
            {
                System.Diagnostics.Debug.WriteLine(" Exception ", exp);
            }
            SongsListView.ItemsSource = Songslist;
            System.Diagnostics.Debug.WriteLine("-------------{0}", playListObj.ImageName);
            setImageToMyMediaElement(playListObj.ImageName);
        }
Exemplo n.º 3
0
        //newer one from 7:32pm. Friday Night.
        private async void GetListOfPlayList()
        {
            var palyListFolder = await KnownFolders.DocumentsLibrary.CreateFolderAsync(MY_PLAYLIST_FOLDER, CreationCollisionOption.OpenIfExists);

            var playlistFiles = await palyListFolder.GetFilesAsync();

            List <PlayListObj> PlayListDropdownFiles = new List <PlayListObj>();

            foreach (var file in playlistFiles)
            {
                PlayListObj obj = new PlayListObj
                {
                    FileName             = file.DisplayName,
                    FilePath             = file.Path,
                    PlayListNameWithExtn = file.Name
                };

                PlayListDropdownFiles.Add(obj);
                System.Diagnostics.Debug.WriteLine("GetListOfPlayList PlayListFile...................{0} {1}\n", file.Name, file.Path);
            }
            PlayListCombo.ItemsSource = PlayListDropdownFiles;
        }