-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
94 lines (65 loc) · 2.84 KB
/
Copy pathProgram.cs
File metadata and controls
94 lines (65 loc) · 2.84 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using DesignPatterns.AbstractFactory;
using DesignPatterns.State;
namespace DesignPatterns
{
class Program
{
static void Main(string[] args)
{
#region Absstract Factory Pattern
//#region FirstSample
////IMobilePhone nokiaMobilePhone = new Nokia();
////MobileClient nokiaClient = new MobileClient(nokiaMobilePhone);
////Console.WriteLine("********* NOKIA **********");
////Console.WriteLine(nokiaClient.GetSmartPhoneModelDetails());
////Console.WriteLine(nokiaClient.GetNormalPhoneModelDetails());
////IMobilePhone samsungMobilePhone = new Samsung();
////MobileClient samsungClient = new MobileClient(samsungMobilePhone);
////Console.WriteLine("******* SAMSUNG **********");
////Console.WriteLine(samsungClient.GetSmartPhoneModelDetails());
////Console.WriteLine(samsungClient.GetNormalPhoneModelDetails());
//#endregion
//#region SecondSample WebinarPlatform
//IWebinarPlatform bbbPlatform = new BigBlueButton();
//WebinarPlatformClient bbbClient = new WebinarPlatformClient(bbbPlatform);
//Console.WriteLine("********* bbb **********");
//Console.WriteLine(bbbClient.JoinWebinar());
//Console.WriteLine(bbbClient.StartAsAttender());
//Console.WriteLine(bbbClient.StartAsManager());
//Console.WriteLine(bbbClient.GetRecords());
//IWebinarPlatform skyRoomPlatform = new SkyRoom();
//WebinarPlatformClient skyRoomClient = new WebinarPlatformClient(skyRoomPlatform);
//Console.WriteLine("******* sky room **********");
//Console.WriteLine(skyRoomClient.JoinWebinar());
//Console.WriteLine(skyRoomClient.StartAsAttender());
//Console.WriteLine(skyRoomClient.StartAsManager());
//Console.WriteLine(skyRoomClient.GetRecords());
//#endregion
#endregion
#region State Pattern
#region FirstSample
// Setup context in a state
//Context c = new Context(new ConcreteStateA());
//// Issue requests, which toggles state
//c.Request();
//c.Request();
//c.Request();
//c.Request();
#endregion
#region BankSample
// Open a new account
Account account = new Account("Jim Johnson");
// Apply financial transactions
account.Deposit(500.0);
account.Deposit(300.0);
account.Deposit(550.0);
account.PayInterest();
account.Withdraw(2000.00);
account.Withdraw(1100.00);
#endregion
#endregion
Console.ReadKey();
}
}
}