Exemplo n.º 1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (CurrentExecutable != null)
         {
             hashCode = hashCode * 59 + CurrentExecutable.GetHashCode();
         }
         if (Idle != null)
         {
             hashCode = hashCode * 59 + Idle.GetHashCode();
         }
         if (LikelyStuck != null)
         {
             hashCode = hashCode * 59 + LikelyStuck.GetHashCode();
         }
         if (Number != null)
         {
             hashCode = hashCode * 59 + Number.GetHashCode();
         }
         if (Progress != null)
         {
             hashCode = hashCode * 59 + Progress.GetHashCode();
         }
         if (Class != null)
         {
             hashCode = hashCode * 59 + Class.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (Class != null)
                {
                    hashCode = hashCode * 59 + Class.GetHashCode();
                }
                if (DisplayName != null)
                {
                    hashCode = hashCode * 59 + DisplayName.GetHashCode();
                }
                if (Executors != null)
                {
                    hashCode = hashCode * 59 + Executors.GetHashCode();
                }
                if (Icon != null)
                {
                    hashCode = hashCode * 59 + Icon.GetHashCode();
                }
                if (IconClassName != null)
                {
                    hashCode = hashCode * 59 + IconClassName.GetHashCode();
                }

                hashCode = hashCode * 59 + Idle.GetHashCode();

                hashCode = hashCode * 59 + JnlpAgent.GetHashCode();

                hashCode = hashCode * 59 + LaunchSupported.GetHashCode();
                if (LoadStatistics != null)
                {
                    hashCode = hashCode * 59 + LoadStatistics.GetHashCode();
                }

                hashCode = hashCode * 59 + ManualLaunchAllowed.GetHashCode();
                if (MonitorData != null)
                {
                    hashCode = hashCode * 59 + MonitorData.GetHashCode();
                }

                hashCode = hashCode * 59 + NumExecutors.GetHashCode();

                hashCode = hashCode * 59 + Offline.GetHashCode();
                if (OfflineCause != null)
                {
                    hashCode = hashCode * 59 + OfflineCause.GetHashCode();
                }
                if (OfflineCauseReason != null)
                {
                    hashCode = hashCode * 59 + OfflineCauseReason.GetHashCode();
                }

                hashCode = hashCode * 59 + TemporarilyOffline.GetHashCode();
                return(hashCode);
            }
        }
Exemplo n.º 3
0
 public override int GetHashCode() =>
 31 *Allocations.GetHashCode() + Evictions.GetHashCode() + Idle.GetHashCode();