Exemple #1
0
 public static bool IsSubDevice(UId id)
 {
     if (id is SubDeviceUId)
     {
         return(((SubDeviceUId)id).SubDeviceId != 0);
     }
     return(false);
 }
Exemple #2
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);
        }
Exemple #3
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));
        }
Exemple #4
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);
     }
 }
Exemple #5
0
 public UId(UId source)
 {
     ManufacturerId = source.ManufacturerId;
     DeviceId       = source.DeviceId;
 }
Exemple #6
0
 public void Write(UId value)
 {
     WriteNetwork((short)value.ManufacturerId);
     WriteNetwork((int)value.DeviceId);
 }
Exemple #7
0
 public SubDeviceUId(UId source, short subDeviceId)
     : base(source)
 {
     SubDeviceId = subDeviceId;
 }