-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDecodedCode.cs
More file actions
31 lines (27 loc) · 895 Bytes
/
Copy pathDecodedCode.cs
File metadata and controls
31 lines (27 loc) · 895 Bytes
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
using System;
namespace PostCodeSerialMonitor.Models;
public class DecodedCode
{
public CodeFlavor Flavor { get; set; }
public UInt64 Code { get; set; }
public CodeSeverity SeverityLevel { get; set; } = CodeSeverity.Info;
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public override int GetHashCode()
{
var result = 0;
result = (result * 397) ^ Convert.ToInt32(Flavor);
result = (result * 397) ^ (int)Code;
result = (result * 397) ^ Convert.ToInt32(SeverityLevel);
return result;
}
public override bool Equals(object? obj) => this.Equals(obj);
public bool Equals(DecodedCode obj)
{
return (
this.Flavor == obj.Flavor
&& this.Code == obj.Code
&& this.SeverityLevel == obj.SeverityLevel
);
}
}