public static void TimedEventTest() { var timer = new Timer(5); var myStudents = new ClassOfStudents(); // Student has a constuctor for testing // subscribing to the testing event TimedEvent // printing first and last name on event myStudents.AddStudent(new Student("1", "1", timer)); myStudents.AddStudent(new Student("2", "2")); myStudents.AddStudent(new Student("3", "3", timer)); timer.Run(); }
public static ClassOfStudents ToClassOfStudents <T>(this IEnumerable <T> collection) where T : Student { var output = new ClassOfStudents(); foreach (dynamic student in collection) { output.AddStudent(student); } return(output); }