public bool IsCompatible(DeviceDescriptor a_device, FwVersion a_upper) { if (VersionCode != a_device.FirmwareVersion.VersionCode) return false; if (a_upper == FwVersion.Upper) { if (VersionNumber > a_device.FirmwareVersion.VersionNumber) return false; } else if (VersionNumber < a_device.FirmwareVersion.VersionNumber) return false; return true; }
public bool IsCompatible(DeviceDescriptor a_device, FwVersion a_upper) { if (this.Name == a_device.FirmwareType.Name) { if (this.FirmwareVersionList.Count == 0) { return true; } for (int i = 0; i < this.FirmwareVersionList.Count; i++) { if (this.FirmwareVersionList[i].VersionCode != a_device.FirmwareVersion.VersionCode) { if ((i < (this.FirmwareVersionList.Count - 1)) && (this.FirmwareVersionList[i].VersionCode == this.FirmwareVersionList[i + 1].VersionCode)) { i++; } } else if (i < (this.FirmwareVersionList.Count - 1)) { if (this.FirmwareVersionList[i].VersionCode == a_device.FirmwareVersion.VersionCode) { if (this.FirmwareVersionList[i].VersionCode != this.FirmwareVersionList[i + 1].VersionCode) { if (this.FirmwareVersionList[i].IsUpperCompatible(a_device)) { return true; } } else if (this.FirmwareVersionList[i].IsUpperCompatible(a_device) && this.FirmwareVersionList[i + 1].IsLowerCompatible(a_device)) { return true; } } } else if (this.FirmwareVersionList[i].IsCompatible(a_device, a_upper)) { return true; } } } return false; }
public bool IsCompatible(DeviceDescriptor a_device, HwVersion a_hwCriteria, FwVersion a_fwCriteria, bool a_checkOnlyDevice) { if (this.TypeID == a_device.DeviceType.TypeID) { if ((this._licenseList.Count > 0) && !this.isLicenseAvailable()) { return false; } if (this.DeviceVersionList.Count == 0) { return true; } for (int i = 0; i < this.DeviceVersionList.Count; i++) { if (this.DeviceVersionList[i].VersionCode != a_device.DeviceVersion.VersionCode) { if ((i < (this.DeviceVersionList.Count - 1)) && (this.DeviceVersionList[i].VersionCode == this.DeviceVersionList[i + 1].VersionCode)) { i++; } } else if (i < (this.DeviceVersionList.Count - 1)) { if (this.DeviceVersionList[i].VersionCode == a_device.DeviceVersion.VersionCode) { if (this.DeviceVersionList[i].VersionCode != this.DeviceVersionList[i + 1].VersionCode) { if (this.DeviceVersionList[i].IsCompatible(a_device, HwVersion.Upper, a_fwCriteria, a_checkOnlyDevice)) { return true; } } else if (this.DeviceVersionList[i].IsCompatible(a_device, HwVersion.Upper, a_fwCriteria, a_checkOnlyDevice) && this.DeviceVersionList[i + 1].IsCompatible(a_device, HwVersion.Lower, a_fwCriteria, a_checkOnlyDevice)) { return true; } } } else if (this.DeviceVersionList[i].IsCompatible(a_device, a_hwCriteria, a_fwCriteria, a_checkOnlyDevice)) { return true; } } } return false; }
public bool IsCompatible(DeviceDescriptor a_device, HwVersion a_hwCriteria, FwVersion a_fwCriteria, bool a_checkOnlyDevice) { if (VersionCode == a_device.DeviceVersion.VersionCode) { if (a_hwCriteria == HwVersion.Upper) { if (VersionNumber > a_device.DeviceVersion.VersionNumber) return false; } else if (VersionNumber < a_device.DeviceVersion.VersionNumber) return false; if (a_checkOnlyDevice || (a_device.FirmwareType == null)) return true; if ((FirmwareTypeList == null) || (FirmwareTypeList.Count == 0)) return true; foreach (FirmwareType type in FirmwareTypeList) if (type.IsCompatible(a_device, a_fwCriteria)) return true; } return false; }
public bool IsCompatible(DeviceDescriptor a_connectedDevice, HwVersion a_hwCriteria, FwVersion a_fwCriteria, bool a_checkOnlyHwTypeAndVersion) { try { if ((a_connectedDevice != null) && (a_connectedDevice.DeviceType != null)) { foreach (DeviceType type in this.DeviceList) { if (type.IsCompatible(a_connectedDevice, a_hwCriteria, a_fwCriteria, a_checkOnlyHwTypeAndVersion)) { if (type.CompatibleComponentDescriptor._deviceTypeList.Count > 0) { bool flag = true; foreach (DeviceType type2 in type.CompatibleComponentDescriptor.DeviceList) { bool flag2 = false; foreach (DeviceDescriptor descriptor in a_connectedDevice.ComponentList) { if (type2.IsCompatible(descriptor, a_hwCriteria, a_fwCriteria, a_checkOnlyHwTypeAndVersion)) { flag2 = true; break; } } if (!flag2) { flag = false; break; } } if (!flag) { break; } } return true; } foreach (DeviceDescriptor descriptor2 in a_connectedDevice.ComponentList) { if (type.IsCompatible(descriptor2, a_hwCriteria, a_fwCriteria, a_checkOnlyHwTypeAndVersion)) { return true; } } } } return false; } catch { return false; } }