Beispiel #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 (Class != null)
         {
             hashCode = hashCode * 59 + Class.GetHashCode();
         }
         if (BusyExecutors != null)
         {
             hashCode = hashCode * 59 + BusyExecutors.GetHashCode();
         }
         if (Computer != null)
         {
             hashCode = hashCode * 59 + Computer.GetHashCode();
         }
         if (DisplayName != null)
         {
             hashCode = hashCode * 59 + DisplayName.GetHashCode();
         }
         if (TotalExecutors != null)
         {
             hashCode = hashCode * 59 + TotalExecutors.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Returns true if ComputerSet instances are equal
        /// </summary>
        /// <param name="other">Instance of ComputerSet to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ComputerSet other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Class == other.Class ||
                     Class != null &&
                     Class.Equals(other.Class)
                     ) &&
                 (
                     BusyExecutors == other.BusyExecutors ||

                     BusyExecutors.Equals(other.BusyExecutors)
                 ) &&
                 (
                     Computer == other.Computer ||
                     Computer != null &&
                     other.Computer != null &&
                     Computer.SequenceEqual(other.Computer)
                 ) &&
                 (
                     DisplayName == other.DisplayName ||
                     DisplayName != null &&
                     DisplayName.Equals(other.DisplayName)
                 ) &&
                 (
                     TotalExecutors == other.TotalExecutors ||

                     TotalExecutors.Equals(other.TotalExecutors)
                 ));
        }