/// <summary>
 /// Determines whether the specified <see cref="UsbDeviceDescriptor"/> is equal to the current <see cref="UsbDeviceDescriptor"/>.
 /// </summary>
 /// <returns>
 /// true if the specified <see cref="UsbDeviceDescriptor"/> is equal to the current <see cref="UsbDeviceDescriptor"/>; otherwise, false.
 /// </returns>
 /// <param name="other">The <see cref="UsbDeviceDescriptor"/> to compare with the current <see cref="UsbDeviceDescriptor"/>. </param><exception cref="T:System.NullReferenceException">The <paramref name="other"/> parameter is null.</exception><filterpriority>2</filterpriority>
 public bool Equals(UsbDeviceDescriptorBase other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other.BcdUsb == BcdUsb && other.Class == Class && other.SubClass == SubClass && other.Protocol == Protocol &&
            other.MaxPacketSize0 == MaxPacketSize0 && other.VendorID == VendorID && other.ProductID == ProductID &&
            other.BcdDevice == BcdDevice && other.ManufacturerStringIndex == ManufacturerStringIndex &&
            other.ProductStringIndex == ProductStringIndex && other.SerialStringIndex == SerialStringIndex &&
            other.ConfigurationCount == ConfigurationCount);
 }
Example #2
0
 public UsbDeviceDescriptorBase(UsbDeviceDescriptorBase usbDeviceDescriptor)
 {
     BcdDevice               = usbDeviceDescriptor.BcdDevice;
     BcdUsb                  = usbDeviceDescriptor.BcdUsb;
     Class                   = usbDeviceDescriptor.Class;
     ConfigurationCount      = usbDeviceDescriptor.ConfigurationCount;
     DescriptorType          = usbDeviceDescriptor.DescriptorType;
     Length                  = usbDeviceDescriptor.Length;
     ManufacturerStringIndex = usbDeviceDescriptor.ManufacturerStringIndex;
     MaxPacketSize0          = usbDeviceDescriptor.MaxPacketSize0;
     ProductID               = usbDeviceDescriptor.ProductID;
     ProductStringIndex      = usbDeviceDescriptor.ProductStringIndex;
     Protocol                = usbDeviceDescriptor.Protocol;
     SerialStringIndex       = usbDeviceDescriptor.SerialStringIndex;
     SubClass                = usbDeviceDescriptor.SubClass;
     VendorID                = usbDeviceDescriptor.VendorID;
 }