-
Notifications
You must be signed in to change notification settings - Fork 0
/
Button.cs
32 lines (27 loc) · 826 Bytes
/
Button.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
32
//============================================================
// Student Number : S10203296, S10205301
// Student Name : Benedict Woo, Melvin Kee
// Module Group : T06
//============================================================
using System;
using COVIDMonitoringSystem.ConsoleApp.Utilities;
namespace COVIDMonitoringSystem.ConsoleApp.Display.Elements
{
public class Button : SelectableElement
{
public Action Runner { get; set; }
public ActionMethod MethodRunner { get; set; }
public Button(string name = null) : base(name)
{
}
public void Run()
{
if (MethodRunner != null)
{
MethodRunner.Run(TargetScreen);
return;
}
Runner?.Invoke();
}
}
}