Hi,
I have following playlist:
Playlist playList = new Playlist();
I am adding the playList ietms to my playList as below:
if (strmediaExtension == "wmv" || strmediaExtension == "mp4" || strmediaExtension == "mp3" || strmediaExtension == "mpg")
{
PlaylistItem playListItem = new PlaylistItem();
string thumbSource = folderItems.strAlbumcoverImage;
playListItem.MediaSource = new Uri(strmediaURL, UriKind.RelativeOrAbsolute);
playListItem.Title = folderItems.strAlbumName;
if (!string.IsNullOrEmpty(thumbSource))
playListItem.ThumbSource = new Uri(thumbSource, UriKind.RelativeOrAbsolute);
playList.Items.Add(playListItem);
}
Now suppose my plaList has 9 Items inside it . I want to iterate through each by using foreach
loop as following:
foreach (PlaylistItem p in playList)
{
//Code Goes here
}
But I am getting the errror:
foreach statement cannot operate on variables of type 'ExpressionMediaPlayer.Playlist' because 'ExpressionMediaPlayer.Playlist' does not contain a public definition for 'GetEnumerator'
Can any one please explain why this is happening and what is the correct way of doing it.
Thanks, Subhhen