-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
31 lines (21 loc) · 1.06 KB
/
Program.cs
File metadata and controls
31 lines (21 loc) · 1.06 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
using System;
using static NotificationApp.FacadeDesign;
using static NotificationApp.ObserverDesign;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the notification sending mode (email or sms):");
string mode = Console.ReadLine();//reading notification sending mode
Console.WriteLine("Enter subject:");
string subject = Console.ReadLine();
Console.WriteLine("Enter body:");
string body = Console.ReadLine();
var notificationFacade = new NotificationFacade(mode); // Instantiation of the necessary objects of the Facade Design Pattern
notificationFacade.ActualSendNotification(subject, body); //printing the sended message on screen using the selected mode and to All Users
// Instantiation and notifying subscribed observers(or Users)
var logger = new NotifyingMultipleUsers();
logger.NotificationtoAllSubscribedUsers("Notification sent successfully to the subscribed users!!!");
Console.ReadKey();
}
}