1
0

43 lines
1.0 KiB
C#

namespace Flawless.Core.Modal;
[Serializable]
public struct WorkspaceFile : IEquatable<WorkspaceFile>
{
public DateTime ModifyTime { get; set; }
public string WorkPath { get; set; }
public ulong Size { get; set; }
public WorkspaceFile(DateTime modifyTime, string workPath, long size)
{
ModifyTime = modifyTime;
WorkPath = workPath;
Size = (ulong) size;
}
public bool Equals(WorkspaceFile other)
{
return ModifyTime.Equals(other.ModifyTime) && WorkPath == other.WorkPath;
}
public override bool Equals(object? obj)
{
return obj is WorkspaceFile other && Equals(other);
}
public override int GetHashCode()
{
return HashCode.Combine(ModifyTime, WorkPath);
}
public static bool operator ==(WorkspaceFile left, WorkspaceFile right)
{
return left.Equals(right);
}
public static bool operator !=(WorkspaceFile left, WorkspaceFile right)
{
return !left.Equals(right);
}
}