-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathBook.cs
33 lines (30 loc) · 841 Bytes
/
Book.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DoFactory.GangOfFour.Decorator.RealWorld
{
/// <summary>
/// The 'ConcreteComponent' class
/// </summary>
public class Book : LibraryItem
{
private string _author;
private string _title;
// Constructor
public Book(string author, string title, int numCopies)
{
_author = author;
_title = title;
NumCopies = numCopies;
}
public override void Display()
{
Console.WriteLine("\nBook ------ ");
Console.WriteLine(" Author: {0}", _author);
Console.WriteLine(" Title: {0}", _title);
Console.WriteLine(" # Copies: {0}", NumCopies);
}
}
}