-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathReportItem.cs
64 lines (58 loc) · 1.5 KB
/
ReportItem.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
using System;
namespace LocalLibrary
{
public class ReportItem
{
private string _name = String.Empty; // Name of game
private bool _new = false; // New game
private bool _updates = false; // Updates available
private int _updatesCount = 0; // Number of updates available
public string Name
{
get => _name;
set
{
if (string.IsNullOrEmpty(value))
{
throw new ArgumentNullException(nameof(value), "Name cannot be null or empty.");
}
_name = value;
}
}
public bool New
{
get => _new;
set
{
_new = value;
}
}
public bool Updates
{
get => _updates;
set
{
_updates = value;
}
}
public int UpdatesCount
{
get => _updatesCount;
set
{
if (value < 0)
{
throw new ArgumentOutOfRangeException(nameof(value), "Updates count cannot be negative.");
}
_updatesCount = value;
}
}
public ReportItem(string name, bool isNew, bool hasUpdates, int updatesCount)
{
Name = name;
New = isNew;
Updates = hasUpdates;
UpdatesCount = updatesCount;
}
}
}