-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask.cs
More file actions
50 lines (44 loc) · 1.39 KB
/
Task.cs
File metadata and controls
50 lines (44 loc) · 1.39 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
48
49
50
namespace TaskFlow;
/// <summary>
/// Represents a task in the task flow system.
/// </summary>
public class Task
{
/// <summary>
/// Gets or sets the unique identifier for the task.
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the title of the task.
/// </summary>
public string Title { get; set; }
/// <summary>
/// Gets or sets the description of the task.
/// </summary>
public string Description { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the task is completed.
/// </summary>
public bool Status { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="Task"/> class.
/// </summary>
/// <param name="title">The title of the task.</param>
/// <param name="description">The description of the task.</param>
public Task(string title, string description)
{
this.Id = Guid.NewGuid();
this.Description = description;
this.Status = false;
this.Title = title;
}
/// <summary>
/// Returns a string that represents the current task.
/// </summary>
/// <returns>A string representation of the task including status and title.</returns>
public override string ToString()
{
string statusText = this.Status ? "Completed" : "Pending";
return $"[{statusText}] {this.Title}";
}
}