AsperaErrorComparer
using System;
using System.Collections.Generic;
namespace Relativity.Transfer.Aspera
{
internal class AsperaErrorComparer : EqualityComparer<AsperaError>
{
public override bool Equals(AsperaError x, AsperaError y)
{
if (x == null && y == null)
return true;
if (x == null || y == null)
return false;
if (x.HandlerType != y.HandlerType)
return false;
if (x.AsperaEventSource != y.AsperaEventSource)
return false;
if (x.ErrorCode != y.ErrorCode)
return false;
return string.Equals(x.ErrorMessage, y.ErrorMessage);
}
public override int GetHashCode(AsperaError obj)
{
return (((((((!(obj.HandlerType != (Type)null)) ? 1 : obj.HandlerType.GetHashCode()) * 397) ^ obj.AsperaEventSource.GetHashCode()) * 397) ^ obj.ErrorCode.GetHashCode()) * 397) ^ ((obj.ErrorMessage == null) ? 1 : obj.ErrorMessage.GetHashCode());
}
}
}