You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
namespace MultiTerm.Protocols.UsbHid;
|
|
|
|
public class UsbHidDeviceInfo : ICloneable, IEquatable<UsbHidDeviceInfo>
|
|
{
|
|
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<UsbHidDeviceInfo> 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
|
|
}
|
|
|