namespace MultiTerm.Protocols.UsbHid; public class UsbHidDeviceInfo : ICloneable, IEquatable { public string VendorId { get; internal set; } = string.Empty; public string ProductId { get; internal set; } = string.Empty; public string Manufacturer { get; internal set; } = string.Empty; public string SerialNumber { get; internal set; } = string.Empty; #region ICloneable Implementation public object Clone() { return base.MemberwiseClone(); } #endregion #region IEquatable Implementation public bool Equals(UsbHidDeviceInfo? other) { // null cases if (other == null && this == null) { return true; } if (other == null && this != null) { return false; } // otherwise if vendor id, product id and serial number match => they are equal if (this.VendorId == other!.VendorId && this.ProductId == other!.ProductId && this.SerialNumber == other!.SerialNumber) { return true; } else { return false; } } #endregion }