public void AddGrade(float grade) { if (AddingGrade != null) { AddGradeEventArgs args = new AddGradeEventArgs(); args.Grade = grade; AddingGrade(this, args); } if (grade >= 0 && grade <= 100) { _grades.Add(grade); } }
private static void OnAddGrade(object sender, AddGradeEventArgs args) { Console.WriteLine("Adding new Grade {0}", args.Grade); }