Korero – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | using System; |
2 | |||
3 | namespace Korero.Database |
||
4 | { |
||
5 | public class DatabaseMessageGroup : DatabaseMessage, IEquatable<DatabaseMessageGroup> |
||
6 | { |
||
7 | #region Public Enums, Properties and Fields |
||
8 | |||
9 | public string Group { get; } |
||
10 | |||
11 | #endregion |
||
12 | |||
13 | #region Constructors, Destructors and Finalizers |
||
14 | |||
15 | public DatabaseMessageGroup(string firstName, string lastName, string message, DateTime time) : base(firstName, |
||
16 | lastName, message, time) |
||
17 | { |
||
18 | } |
||
19 | |||
20 | public DatabaseMessageGroup(string firstName, string lastName, string message, string group, DateTime time) : |
||
21 | base(firstName, lastName, message, time) |
||
22 | { |
||
23 | Group = group; |
||
24 | } |
||
25 | |||
26 | #endregion |
||
27 | |||
28 | #region Interface |
||
29 | |||
30 | public bool Equals(DatabaseMessageGroup other) |
||
31 | { |
||
32 | if (ReferenceEquals(null, other)) |
||
33 | { |
||
34 | return false; |
||
35 | } |
||
36 | |||
37 | if (ReferenceEquals(this, other)) |
||
38 | { |
||
39 | return true; |
||
40 | } |
||
41 | |||
42 | return base.Equals(other) && Group == other.Group; |
||
43 | } |
||
44 | |||
45 | #endregion |
||
46 | |||
47 | #region Public Overrides |
||
48 | |||
49 | public override bool Equals(object obj) |
||
50 | { |
||
51 | if (ReferenceEquals(null, obj)) |
||
52 | { |
||
53 | return false; |
||
54 | } |
||
55 | |||
56 | if (ReferenceEquals(this, obj)) |
||
57 | { |
||
58 | return true; |
||
59 | } |
||
60 | |||
61 | if (obj.GetType() != GetType()) |
||
62 | { |
||
63 | return false; |
||
64 | } |
||
65 | |||
66 | return Equals((DatabaseMessageGroup) obj); |
||
67 | } |
||
68 | |||
69 | public override int GetHashCode() |
||
70 | { |
||
71 | unchecked |
||
72 | { |
||
73 | return base.GetHashCode() * 397 ^ (Group != null ? Group.GetHashCode() : 0); |
||
74 | } |
||
75 | } |
||
76 | |||
77 | #endregion |
||
78 | } |
||
79 | } |