コード例 #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
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(Status.GetHashCode() * 11 ^
                       CurrentTime.GetHashCode() * 7 ^
                       Interval.GetHashCode() * 5 ^

                       (StatusInfo != null
                            ? StatusInfo.GetHashCode()
                            : 0) * 3 ^

                       (CustomData != null
                            ? CustomData.GetHashCode()
                            : 0));
            }
        }