-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
47 lines (41 loc) · 1.24 KB
/
Program.cs
File metadata and controls
47 lines (41 loc) · 1.24 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
using BridgePattern;
using System;
using System.Collections.Generic;
namespace BridgePatter.Console
{
class Program
{
static void Main(string[] args)
{
List<Document> documents = new List<Document>();
IFormatterBridge formatter = new StandardFormatter();
var book = new Book(formatter)
{
Author = "Dan Brown",
Title = "The Da Vinci Code",
Text = "Blah blah blah ..."
};
documents.Add(book);
var paper = new TermPaper(formatter)
{
Class = "Software Engineering",
Student = "Jeremy Hall, Clara Knight",
References = "SWE101",
Text = "Blah blah blah ..."
};
documents.Add(paper);
var faq = new FAQ(formatter)
{
Title = "Design Patterns"
};
faq.Questions.Add("Who owns this?", "No one");
faq.Questions.Add("Who created this?", "No one");
documents.Add(faq);
foreach (var document in documents)
{
document.Print();
}
System.Console.ReadLine();
}
}
}