public override int GetHashCode() { unchecked { var hashCode = Amperage.GetHashCode(); hashCode = (hashCode * 397) ^ Current.GetHashCode(); hashCode = (hashCode * 397) ^ Resistance.GetHashCode(); return(hashCode); } }
/// <summary> /// Return a text-representation of this object. /// </summary> public override String ToString() => new String[] { PowerType.HasValue?PowerType.ToString() : "", Voltage.HasValue ? Voltage.ToString() + " V" : "", Amperage.HasValue ? Amperage.ToString() + " A" : "", Power.HasValue ? Power.ToString() + " KW" : "" } .AggregateWith(",");
/// <summary> /// Return the HashCode of this object. /// </summary> /// <returns>The HashCode of this object.</returns> public override Int32 GetHashCode() { unchecked { return((PowerType.HasValue ? PowerType.GetHashCode() * 7 : 0) ^ (Voltage.HasValue ? Voltage.GetHashCode() * 5 : 0) ^ (Amperage.HasValue ? Amperage.GetHashCode() * 3 : 0) ^ (Power.HasValue ? Power.GetHashCode() : 0)); } }
protected bool Equals(ElectricProperties other) { return(Amperage.Equals(other.Amperage) && Current.Equals(other.Current) && Resistance.Equals(other.Resistance)); }