diff --git a/gradebook/src/GradeBook/Book.cs b/gradebook/src/GradeBook/Book.cs index f5d95bc..58a0e03 100644 --- a/gradebook/src/GradeBook/Book.cs +++ b/gradebook/src/GradeBook/Book.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Collections.Generic; namespace GradeBook @@ -39,8 +40,31 @@ namespace GradeBook } public abstract void AddGrade(double grade); - public virtual event GradeAddedDelegate GradeAdded; - public virtual Statistics GetStatistics() + public abstract event GradeAddedDelegate GradeAdded; + public abstract Statistics GetStatistics(); + } + + public class DiskBook : Book + { + public DiskBook(string name) : base(name) + { + } + + public override event GradeAddedDelegate GradeAdded; + + public override void AddGrade(double grade) + { + using(var writer = File.AppendText($"{Name}.txt")) + { + writer.WriteLine("Test"); + if (GradeAdded != null) + { + GradeAdded(this, new EventArgs()); + } + } + } + + public override Statistics GetStatistics() { throw new NotImplementedException(); }