/
GitBinFileInfo.cs
39 lines (34 loc) · 1.09 KB
/
GitBinFileInfo.cs
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
using System;
namespace GitBin
{
public class GitBinFileInfo
{
public string Name { get; private set; }
public long Size { get; private set; }
public GitBinFileInfo(string name, long size)
{
this.Name = name;
this.Size = size;
}
public bool Equals(GitBinFileInfo other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Equals(other.Name, Name) && other.Size == Size;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != typeof(GitBinFileInfo)) return false;
return Equals((GitBinFileInfo)obj);
}
public override int GetHashCode()
{
unchecked
{
return ((Name != null ? Name.GetHashCode() : 0) * 397) ^ Size.GetHashCode();
}
}
}
}