Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// UID 比较
        /// </summary>
        /// <param name="obj">要比较的 UID</param>
        /// <returns>是否一致</returns>
        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));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="source">UID 信息</param>
 public UId(UId source)
 {
     ManufacturerId = source.ManufacturerId;
     DeviceId       = source.DeviceId;
 }
Ejemplo n.º 4
0
        public override bool Equals(object obj)
        {
            UId uid = obj as UId;

            return(uid.ManufacturerId.Equals(ManufacturerId) && uid.DeviceId.Equals(DeviceId));
        }
Ejemplo n.º 5
-1
 public void Write(UId value)
 {
     WriteNetwork((short)value.ManufacturerId);
     WriteNetwork((int)value.DeviceId);
 }
Ejemplo n.º 6
-1
 public UId(UId source)
 {
     ManufacturerId = source.ManufacturerId;
     DeviceId = source.DeviceId;
 }