-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSlideRecord.cs
More file actions
45 lines (40 loc) · 1.11 KB
/
SlideRecord.cs
File metadata and controls
45 lines (40 loc) · 1.11 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
namespace linq_slideviews
{
public class SlideRecord
{
public SlideRecord(int slideId, SlideType slideType, string unitTitle)
{
SlideId = slideId;
SlideType = slideType;
UnitTitle = unitTitle;
}
public readonly int SlideId;
public readonly SlideType SlideType;
public readonly string UnitTitle;
public override string ToString()
{
return $"{nameof(SlideId)}: {SlideId}, {nameof(SlideType)}: {SlideType}, {nameof(UnitTitle)}: {UnitTitle}";
}
protected bool Equals(SlideRecord other)
{
return SlideId == other.SlideId && SlideType == other.SlideType && string.Equals(UnitTitle, other.UnitTitle);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((SlideRecord) obj);
}
public override int GetHashCode()
{
unchecked
{
var hashCode = SlideId;
hashCode = (hashCode*397) ^ (int) SlideType;
hashCode = (hashCode*397) ^ (UnitTitle != null ? UnitTitle.GetHashCode() : 0);
return hashCode;
}
}
}
}