forked from ahotko/c-sharp-code-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PatternsSample.cs
29 lines (28 loc) · 973 Bytes
/
PatternsSample.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
using CodeSamples.Patterns.Behavioral;
using CodeSamples.Patterns.Creational;
namespace CodeSamples.Patterns
{
public class PatternsSample : SampleExecute
{
public override void Execute()
{
Title("PatternsSampleExecute");
Section("Creational Patterns");
var singleton = new SingletonPatternSample();
singleton.Execute();
var factoryMethod = new FactoryMethodPatternSample();
factoryMethod.Execute();
var abstractFactory = new AbstractFactoryPatternSample();
abstractFactory.Execute();
LineBreak();
Section("Behavioral Patterns");
var strategy = new StrategyPatternSample();
strategy.Execute();
var observer = new ObserverPatternSample();
observer.Execute();
var state = new StatePatternSample();
state.Execute();
Finish();
}
}
}