-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSoldProduct.cs
More file actions
39 lines (32 loc) · 1.07 KB
/
Copy pathSoldProduct.cs
File metadata and controls
39 lines (32 loc) · 1.07 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
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PDFiller
{
/// <summary>
/// <see cref="SoldProduct"/> is a wrapper-class over <see cref="Product"/>
/// that offers extrinsic functionality over the <see href="https://refactoring.guru/design-patterns/flyweight"> Flyweight design pattern </see>.
/// </summary>
internal class SoldProduct
{
private Product product;
private int quantity;
public string Name{ get => product.Name; }
public byte[] ImageBuffer { get => product.ImageBuffer; }
public Bitmap Image { get => product.Image; }
public string Id { get => product.Id; }
public int Quantity { get => quantity; set => quantity = value; }
public SoldProduct() {
product = new Product();
quantity = 0;
}
public SoldProduct(Product product, int quantity)
{
this.product = product;
this.quantity = quantity;
}
}
}