Exemplo n.º 1
0
 /*
  * parameters:
  * Movies = This is the movie collection to be passed down and accessed within the Member object.
  *
  * This displays all of the Movies within the community library.
  *
  * returns: nothing.
  */
 private void DisplayMovies(MovieCollection Movies)
 {
     Console.Clear();
     Movies.DisplayTree();
     Console.WriteLine("");
     Console.WriteLine("Please press 'Enter' to continue...");
     Console.ReadLine();
 }
Exemplo n.º 2
0
        /*
         * parameters:
         * Movies = Contains a binary search tree of Movie objects that are to be passed and accessed.
         *
         * This displays the RemoveMovie function where an input is taken and is searched through the BST of Movies, and promptly deletes that Movie.
         *
         * returns: nothing
         */

        public static void RemoveMovie(MovieCollection Movies)
        {
            Console.Clear();
            Movies.DisplayTree();
            bool RemoveCatch = true;

            while (RemoveCatch)
            {
                RemoveCatch = false;
                Console.Write("Enter Movie Title to remove from Collection or press 'ENTER' to exit: ");
                string title = Console.ReadLine();
                try { if (title != "")
                      {
                          Movies.deleteKey(title, "Removed ");
                          Console.WriteLine("");
                          Console.WriteLine("press 'ENTER' to continue");
                          Console.ReadLine();
                      }
                } catch { Console.WriteLine("ERROR: Please enter valid input"); RemoveCatch = true; }
            }
        }