using System; using Shuttle.Servers; namespace JD.Adobe.Service.ExecutableManagement { public class AdobeExecutableInfo { public AdobeApplicationType AppType { get; } public int VersionNumber { get; } public string ExecutablePath { get; } public AdobeExecutableInfo(AdobeApplicationType appType, int versionNumber, string executablePath) { AppType = appType; VersionNumber = versionNumber; ExecutablePath = executablePath ?? throw new ArgumentNullException(nameof(executablePath)); } public override bool Equals(object obj) { if (ReferenceEquals(this, obj)) { return true; } var otherAdobeExecutableInfo = obj as AdobeExecutableInfo; return otherAdobeExecutableInfo != null && AppType == otherAdobeExecutableInfo.AppType && VersionNumber == otherAdobeExecutableInfo.VersionNumber && ExecutablePath == otherAdobeExecutableInfo.ExecutablePath; } public override int GetHashCode() { var hashCode = -984464135; hashCode ^= AppType.GetHashCode(); hashCode ^= VersionNumber.GetHashCode(); hashCode ^= ExecutablePath.GetHashCode(); return hashCode; } public override string ToString() { return $"{AppType.ToString()} {VersionNumber}"; } } }