예제 #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Label != null)
         {
             hashCode = hashCode * 59 + Label.GetHashCode();
         }
         if (BridgeUID != null)
         {
             hashCode = hashCode * 59 + BridgeUID.GetHashCode();
         }
         if (Configuration != null)
         {
             hashCode = hashCode * 59 + Configuration.GetHashCode();
         }
         if (Properties != null)
         {
             hashCode = hashCode * 59 + Properties.GetHashCode();
         }
         if (UID != null)
         {
             hashCode = hashCode * 59 + UID.GetHashCode();
         }
         if (ThingTypeUID != null)
         {
             hashCode = hashCode * 59 + ThingTypeUID.GetHashCode();
         }
         if (Channels != null)
         {
             hashCode = hashCode * 59 + Channels.GetHashCode();
         }
         if (Location != null)
         {
             hashCode = hashCode * 59 + Location.GetHashCode();
         }
         if (StatusInfo != null)
         {
             hashCode = hashCode * 59 + StatusInfo.GetHashCode();
         }
         if (FirmwareStatus != null)
         {
             hashCode = hashCode * 59 + FirmwareStatus.GetHashCode();
         }
         if (Editable != null)
         {
             hashCode = hashCode * 59 + Editable.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Label != null?Label.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (BridgeUid != null ? BridgeUid.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Configuration != null ? Configuration.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Properties != null ? Properties.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Uid != null ? Uid.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ThingTypeUid != null ? ThingTypeUid.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Channels != null ? Channels.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Location != null ? Location.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (StatusInfo != null ? StatusInfo.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (FirmwareStatus != null ? FirmwareStatus.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Editable.GetHashCode();
                return(hashCode);
            }
        }