static void Main(string[] args) { CollegeClassModel history = new CollegeClassModel("History 101", 3); CollegeClassModel math = new CollegeClassModel("Calculus 201", 2); //history.EnrollmentFull += History_EnrollmentFull; history.EnrollmentFull += CollegeClass_EnrollmentFull; history.SignUpStudents("Claudia Ziemba").PrintToConsole(); history.SignUpStudents("Julian Alberto").PrintToConsole(); history.SignUpStudents("Marco J").PrintToConsole(); history.SignUpStudents("Esther Z").PrintToConsole(); history.SignUpStudents("Luli Louless").PrintToConsole(); Console.WriteLine(); math.EnrollmentFull += CollegeClass_EnrollmentFull; //math.EnrollmentFull += Math_EnrollmentFull; math.SignUpStudents("Claudia Ziemba").PrintToConsole(); math.SignUpStudents("Julian Alberto").PrintToConsole(); math.SignUpStudents("Marco J").PrintToConsole(); Console.ReadLine(); }
private static void CollegeClass_EnrollmentFull(object sender, string e) { CollegeClassModel model = (CollegeClassModel)sender; Console.WriteLine(); //Console.WriteLine($"The enrollment is full for {e}"); Console.WriteLine($"{model.CourseTitle}: Full."); Console.WriteLine(); }
static void Main(string[] args) { CollegeClassModel history = new CollegeClassModel("History101", 2); CollegeClassModel math = new CollegeClassModel("Calculs 203", 3); history.EnrollmentFull += Class_EnrollmentFull; history.SignUpStudents("Tulasi").PrintMessage(); history.SignUpStudents("Puran").PrintMessage(); history.SignUpStudents("Pujan").PrintMessage(); history.SignUpStudents("Nirjala").PrintMessage(); history.SignUpStudents("Saraswoti").PrintMessage(); "--------------------------------------------------------------".PrintMessage(); math.EnrollmentFull += Class_EnrollmentFull; math.SignUpStudents("Adish").PrintMessage(); math.SignUpStudents("Kendrit").PrintMessage(); math.SignUpStudents("Samundra").PrintMessage(); math.SignUpStudents("Sudarshan").PrintMessage(); math.SignUpStudents("Prastab").PrintMessage(); }