forked from EdisonTalk/DesignPattern.Samples.CSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathButton.cs
78 lines (70 loc) · 1.72 KB
/
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
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EDC.DesignPattern.Mediator
{
/// <summary>
/// 具体同事类:按钮组件
/// </summary>
public class Button : Component
{
public override void Update()
{
// 按钮不产生响应
}
}
/// <summary>
/// 具体同事类:列表框组件
/// </summary>
public class List : Component
{
public override void Update()
{
Console.WriteLine("列表框增加一项:张无忌");
}
public void Select()
{
Console.WriteLine("列表框选中项:小龙女");
}
}
/// <summary>
/// 具体同事类:组合框组件
/// </summary>
public class ComboBox : Component
{
public override void Update()
{
Console.WriteLine("组合框增加一项:张无忌");
}
public void Select()
{
Console.WriteLine("组合框选中项:小龙女");
}
}
/// <summary>
/// 具体同事类:文本框组件
/// </summary>
public class TextBox : Component
{
public override void Update()
{
Console.WriteLine("客户信息增加成功后文本框清空");
}
public void SetText()
{
Console.WriteLine("文本框显示:小龙女");
}
}
/// <summary>
/// 具体同事类:标签组件
/// </summary>
public class Label : Component
{
public override void Update()
{
Console.WriteLine("文本标签内容改变,客户信息总数量加1");
}
}
}