forked from BornToBeRoot/NETworkManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplicationInfo.cs
More file actions
76 lines (64 loc) · 1.94 KB
/
Copy pathApplicationInfo.cs
File metadata and controls
76 lines (64 loc) · 1.94 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
namespace NETworkManager.Models;
/// <summary>
/// Stores informations about an application.
/// </summary>
public class ApplicationInfo
{
/// <summary>
/// Name of the application.
/// </summary>
public ApplicationName Name { get; set; }
/// <summary>
/// Indicates that the application is visible to the user.
/// </summary>
public bool IsVisible { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ApplicationInfo"/> class.
/// </summary>
public ApplicationInfo()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ApplicationInfo"/> class with paramteters.
/// </summary>
/// <param name="name"><see cref="Name"/></param>
public ApplicationInfo(ApplicationName name)
{
Name = name;
IsVisible = true;
}
/// <summary>
/// Method to check if an object is equal to this object.
/// </summary>
/// <param name="info">Object to check.</param>
/// <returns>Equality as <see cref="bool"/>.</returns>
public bool Equals(ApplicationInfo info)
{
if (info == null)
return false;
return Name == info.Name;
}
/// <summary>
/// Method to check if an object is equal to this object.
/// </summary>
/// <param name="obj">Object from type <see cref="ApplicationInfo" /> to check.</param>
/// <returns>Equality as <see cref="bool"/>.</returns>
public override bool Equals(object obj)
{
if (obj is null)
return false;
if (ReferenceEquals(this, obj))
return true;
if (obj.GetType() != GetType())
return false;
return Equals(obj as ApplicationInfo);
}
/// <summary>
/// Method to return the hash code of this object.
/// </summary>
/// <returns>Hashcode as <see cref="int"/>.</returns>
public override int GetHashCode()
{
return Name.GetHashCode();
}
}