示例#1
0
 public static bool IsSubDevice(UId id)
 {
     if (id is SubDeviceUId)
     {
         return(((SubDeviceUId)id).SubDeviceId != 0);
     }
     return(false);
 }
示例#2
0
 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);
     }
 }
示例#3
0
        public int CompareTo(object obj)
        {
            UId id = obj as UId;

            if (id != null)
            {
                return(ManufacturerId.CompareTo(id.ManufacturerId) + DeviceId.CompareTo(id.DeviceId));
            }

            return(-1);
        }
示例#4
0
        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 void Write(UId value)
 {
     WriteNetwork((short)value.ManufacturerId);
     WriteNetwork((int)value.DeviceId);
 }
示例#6
0
 public SubDeviceUId(UId source, short subDeviceId)
     : base(source)
 {
     SubDeviceId = subDeviceId;
 }
示例#7
0
 public UId(UId source)
 {
     ManufacturerId = source.ManufacturerId;
     DeviceId       = source.DeviceId;
 }