Esempio n. 1
0
 public void Shuffle(Item item)
 {
     Folder folder = item.BaseItem as Folder;
     if (folder != null)
     {
         Random rnd = new Random();
         var playableChildren = folder.RecursiveChildren.Select(i => i as Video).Where(v => v != null).OrderBy(i => rnd.Next());
         PlayableItem playable = new PlayableCollection(item.Name, playableChildren);
         playable.Play(null, false);
     }
 }
Esempio n. 2
0
        public void Unwatched(Item item)
        {
            Folder folder = item.BaseItem as Folder;
            if (folder != null)
            {

                var playableChildren = folder.RecursiveChildren.Select(i => i as Video).Where(v => v != null && !v.PlaybackStatus.WasPlayed).OrderBy(v => v.Path);
                PlayableItem playable = new PlayableCollection(item.Name, playableChildren);
                playable.Play(null, false);
            }
        }
Esempio n. 3
0
 public void Play(Item item)
 {
     if (item.IsPlayable)
     {
         item.Play();
     }
     else
     {
         Folder folder = item.BaseItem as Folder;
         if (folder != null)
         {
             var playableChildren = folder.RecursiveChildren.Select(i => i as Video).Where(v => v != null).OrderBy(v => v.Path);
             PlayableItem playable = new PlayableCollection(item.Name, playableChildren);
             playable.Play(null, false);
         }
     }
 }