Exemplo n.º 1
0
 public Song[] SortSongs(Song[] songs, int index)
 {
     switch (index)
     {
         case -1:
             return songs;
         case 0:
             return songs.OrderBy(s => s.Path).OrderByDescending(s => s.CreationTime).ToArray();
         case 1:
             return songs.OrderBy(s => s.Path).OrderBy(s => s.Title).ToArray();
         case 2:
             return songs.OrderBy(s => s.Path).OrderBy(s => s.Artist).ToArray();
     }
     return null;
 }
Exemplo n.º 2
0
 public Song[] MixSongs(Song[] songs)
 {
     var rand = new Random();
     return songs.OrderBy(f => rand.Next(0, songs.Length)).ToArray();
 }