Exemplo n.º 1
0
 /// <summary>
 /// List all the media from media array
 /// </summary>
 public void listOfMediaObjects()
 {
     foreach (Media i in mediaArrayForObjects)
     {
         if (i == null)
         {
             break;
         }
         Type type = i.GetType();
         Console.WriteLine("********************");
         if (type.Name == "Book")
         {
             Console.WriteLine("*** BOOK ***");
             Book book = (Book)i;
             book.showBooks();
         }
         if (type.Name == "Movie")
         {
             Console.WriteLine("*** MOVIE ***");
             Movie movie = (Movie)i;
             movie.showMovies();
         }
         if (type.Name == "Song")
         {
             Console.WriteLine("*** SONG ***");
             Song song = (Song)i;
             song.DisplaySong();
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// List all the movies from media array
 /// </summary>
 public void listOfMovies()
 {
     foreach (Media i in mediaArrayForObjects)
     {
         if (i == null)
         {
             break;
         }
         Type type = i.GetType();
         if (type.Name == "Movie")
         {
             Console.WriteLine("********************");
             Movie movie = (Movie)i;
             movie.showMovies();
         }
     }
 }