-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
31 lines (27 loc) · 850 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using Testingproject;
using static Testingproject.GradeAddedDelegate;
namespace testingproject
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
DiskBook book = new DiskBook("Romeo and Juliet");
// add the static method
// right after instantiating the book
// book.GradeAdded += AddedGradeEvent;
book.AddGrade(12.5);
System.Console.WriteLine(book.Name);
// read from file
book.ReadDisk();
}
// static method that will handle the event log on the
// console "Grade has been added"
static void AddedGradeEvent(object sender, EventArgs e)
{
System.Console.WriteLine("Grade has been added");
}
}
}