Beispiel #1
0
        private void CurrentMedia_MediaEnded(object sender, EventArgs e)
        {
            MediaQueueItem firstItem = mediaList.First();

            mediaList.RemoveAt(0);
            mediaList.Add(firstItem);
            currentMedia.Close();
            currentMedia.Open(new Uri(mediaList.First().filePath));
            currentMedia.Play();
        }
Beispiel #2
0
 public void RemoveFromMediaList(MediaQueueItem item)
 {
     if (mediaList.IndexOf(item) == 0)
     {
         if (isPlaying)
         {
             currentMedia.Stop();
             if (mediaList.Count <= 1)
             {
                 currentMedia.Close();
                 isPlaying = false;
             }
         }
     }
     mediaList.Remove(item);
     if (mediaList.Count > 0)
     {
         currentMedia.Open(new Uri(mediaList.First().filePath));
         if (isPlaying)
         {
             currentMedia.Play();
         }
     }
 }
 void listItemQueuedSound_RemoveSound(object sender, RoutedEventArgs e, MediaQueueItem item)
 {
     soundManager.RemoveFromMediaList(item);
     RefreshMediaQueueList();
 }