| | 1 | | namespace SharpHoundCommonLib.OutputTypes |
| | 2 | | { |
| | 3 | | public class Session |
| | 4 | | { |
| | 5 | | private string _computerSID; |
| | 6 | | private string _userSID; |
| | 7 | |
|
| | 8 | | public string UserSID |
| | 9 | | { |
| 2 | 10 | | get => _userSID; |
| 14 | 11 | | set => _userSID = value?.ToUpper(); |
| | 12 | | } |
| | 13 | |
|
| | 14 | | public string ComputerSID |
| | 15 | | { |
| 2 | 16 | | get => _computerSID; |
| 14 | 17 | | set => _computerSID = value?.ToUpper(); |
| | 18 | | } |
| | 19 | |
|
| | 20 | | protected bool Equals(Session other) |
| 7 | 21 | | { |
| 7 | 22 | | return _computerSID == other._computerSID && _userSID == other._userSID; |
| 7 | 23 | | } |
| | 24 | |
|
| | 25 | | public override bool Equals(object obj) |
| 7 | 26 | | { |
| 7 | 27 | | if (ReferenceEquals(null, obj)) return false; |
| 7 | 28 | | if (ReferenceEquals(this, obj)) return true; |
| 7 | 29 | | if (obj.GetType() != GetType()) return false; |
| 7 | 30 | | return Equals((Session) obj); |
| 7 | 31 | | } |
| | 32 | |
|
| | 33 | | public override int GetHashCode() |
| 0 | 34 | | { |
| | 35 | | unchecked |
| 0 | 36 | | { |
| 0 | 37 | | return ((_computerSID != null ? _computerSID.GetHashCode() : 0) * 397) ^ |
| 0 | 38 | | (_userSID != null ? _userSID.GetHashCode() : 0); |
| | 39 | | } |
| 0 | 40 | | } |
| | 41 | | } |
| | 42 | | } |