-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskModels.cs
More file actions
46 lines (40 loc) · 1.24 KB
/
TaskModels.cs
File metadata and controls
46 lines (40 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
using System.Collections.Generic;
namespace PricisApp
{
/// <summary>
/// Represents a category for tasks.
/// </summary>
public class Category
{
public int Id { get; }
public string Name { get; }
public string Color { get; }
public Category(int id, string name, string color)
{
Id = id;
Name = name ?? string.Empty;
Color = color ?? "#FFFFFF";
}
public override string ToString() => Name;
}
/// <summary>
/// Represents a task item.
/// </summary>
public class TaskItem
{
public int Id { get; }
public string Name { get; }
public bool IsComplete { get; set; }
public Category? Category { get; set; }
public IReadOnlyList<string>? Tags { get; set; }
public TaskItem(int id, string name, bool isComplete = false, Category? category = null, IReadOnlyList<string>? tags = null)
{
Id = id;
Name = name ?? string.Empty;
IsComplete = isComplete;
Category = category;
Tags = tags ?? new List<string>();
}
public override string ToString() => Name;
}
}