-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (35 loc) · 1010 Bytes
/
Program.cs
File metadata and controls
36 lines (35 loc) · 1010 Bytes
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
33
34
35
36
namespace DesignPattern
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Select a design pattern to run:");
Console.WriteLine("1. Singleton");
Console.WriteLine("2. Factory Method");
Console.WriteLine("3. Decorator");
Console.WriteLine("4. Observer");
// Add more opt
var choice = Console.ReadLine();
switch (choice)
{
case "1":
SingletonExample.Run();
break;
case "2":
FactoryMethodExample.Run();
break;
case "3":
DecoratorExample.Run();
break;
case "4":
ObserverExample.Run();
break;
default:
Console.WriteLine("Invalid choice.");
break;
}
}
}
}