public static bool IsSubDevice(UId id) { if (id is SubDeviceUId) { return(((SubDeviceUId)id).SubDeviceId != 0); } return(false); }
public int CompareTo(object obj) { UId id = obj as UId; if (id != null) { return(ManufacturerId.CompareTo(id.ManufacturerId) + DeviceId.CompareTo(id.DeviceId)); } return(-1); }
public override bool Equals(object obj) { UId id = obj as UId; if (!object.ReferenceEquals(id, null)) { return(id.ManufacturerId.Equals(ManufacturerId) && id.DeviceId.Equals(DeviceId)); } return(base.Equals(obj)); }
public static bool IsMatch(UId sourceId, UId compareId, int subDeviceId) { if (IsSubDevice(sourceId)) { return(sourceId.Equals(compareId) && ((SubDeviceUId)sourceId).SubDeviceId == subDeviceId); } else { return(sourceId.Equals(compareId) && subDeviceId == 0); } }
public UId(UId source) { ManufacturerId = source.ManufacturerId; DeviceId = source.DeviceId; }
public void Write(UId value) { WriteNetwork((short)value.ManufacturerId); WriteNetwork((int)value.DeviceId); }
public SubDeviceUId(UId source, short subDeviceId) : base(source) { SubDeviceId = subDeviceId; }