Ejemplo n.º 1
0
        private static GradeTracker CreateGradeBook()
        {
            // SpeechSynthesizer synth = new SpeechSynthesizer();
            // synth.Speak("Hello! This is a gradebook program.");

            var book = new ThrowAwayGradeBook();

            /* book.NameChanged += OnNameChanged;
             * book.NameChanged += OnNameChanged2; */

            return(book);
        }
Ejemplo n.º 2
0
        private static GradeTracker InitializeGradeBook()
        {
            GradeTracker gb = new ThrowAwayGradeBook("My gradebook");

            gb.onNameChanged += ChangingName;
            gb.WelcomeNewVal += ChangedName;

            string book_name;

            do
            {
                Console.WriteLine("Enter a gradebook name");
                book_name = Console.ReadLine();
            } while (validateGradeBookName(gb, book_name) == 1);
            Console.WriteLine(gb.Name);
            return(gb);
        }