void ShowStudent(object sender, EventArgs e) { // Student student = ((Student)((AppEventArgs)e).Info); AppEventArgs ae = (AppEventArgs)e; Student student = (Student)ae.Info; txtStudentID.Text = student.StudentID.ToString(); txtStudentName.Text = student.StudentName; }
private void btnShowStudentDetails_Click(object sender, EventArgs e) { Student student = new Student(); student.StudentID = Convert.ToInt32(txtStudentID.Text); student.StudentName = txtStudentName.Text; AppEventArgs ae = new AppEventArgs(); ae.Info = student; AppEvents.OnShowStudentEvent(sender, ae); //AppEvents.OnShowStudentEvent(sender, new AppEventArgs(student)); }