/// <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 (AvailablePhysicalMemory != null) { hashCode = hashCode * 59 + AvailablePhysicalMemory.GetHashCode(); } if (AvailableSwapSpace != null) { hashCode = hashCode * 59 + AvailableSwapSpace.GetHashCode(); } if (TotalPhysicalMemory != null) { hashCode = hashCode * 59 + TotalPhysicalMemory.GetHashCode(); } if (TotalSwapSpace != null) { hashCode = hashCode * 59 + TotalSwapSpace.GetHashCode(); } return(hashCode); } }
public List <string[]> ToArrayList() { var result = new List <string[]> { new[] { "Server version:", ServerVersion }, new[] { "Start time:", StartTime.ToString(CultureInfo.CurrentCulture) }, new[] { "CPU count:", CPUCount.ToString(CultureInfo.InvariantCulture) }, new[] { "Physical memory:", PhysicalMemory.ToString(CultureInfo.InvariantCulture) + " Kb" }, new[] { "Available memory:", AvailablePhysicalMemory.ToString(CultureInfo.InvariantCulture) + " Kb" }, }; return(result); }
/// <summary> /// Returns true if SwapSpaceMonitorMemoryUsage2 instances are equal /// </summary> /// <param name="other">Instance of SwapSpaceMonitorMemoryUsage2 to be compared</param> /// <returns>Boolean</returns> public bool Equals(SwapSpaceMonitorMemoryUsage2 other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Class == other.Class || Class != null && Class.Equals(other.Class) ) && ( AvailablePhysicalMemory == other.AvailablePhysicalMemory || AvailablePhysicalMemory.Equals(other.AvailablePhysicalMemory) ) && ( AvailableSwapSpace == other.AvailableSwapSpace || AvailableSwapSpace.Equals(other.AvailableSwapSpace) ) && ( TotalPhysicalMemory == other.TotalPhysicalMemory || TotalPhysicalMemory.Equals(other.TotalPhysicalMemory) ) && ( TotalSwapSpace == other.TotalSwapSpace || TotalSwapSpace.Equals(other.TotalSwapSpace) )); }