-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathProgram.cs
More file actions
30 lines (24 loc) · 709 Bytes
/
Program.cs
File metadata and controls
30 lines (24 loc) · 709 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
using Observer.Notifies;
using Observer.StockObservers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Observer
{
public static class Program
{
public static void Main(string[] args)
{
var secret = new Secretary();
var stockObserver1 = new StockObserver("看股票同事1", secret);
var stockObserver2 = new StockObserver("看股票同事2", secret);
secret.Attach(stockObserver1);
secret.Attach(stockObserver2);
secret.SecretyAction = "Boss Coming";
secret.Notify();
Console.Read();
}
}
}