protected bool Equals(YogaCachedMeasurement other) { bool isEqual = WidthMeasureMode == other.WidthMeasureMode && HeightMeasureMode == other.HeightMeasureMode; if (AvailableWidth.HasValue() || other.AvailableWidth.HasValue()) { isEqual = isEqual && FloatsEqual(AvailableWidth, other.AvailableWidth); } if (AvailableHeight.HasValue() || other.AvailableHeight.HasValue()) { isEqual = isEqual && FloatsEqual(AvailableHeight, other.AvailableHeight); } if (ComputedWidth.HasValue() || other.ComputedWidth.HasValue()) { isEqual = isEqual && FloatsEqual(ComputedWidth, other.ComputedWidth); } if (ComputedHeight.HasValue() || other.ComputedHeight.HasValue()) { isEqual = isEqual && FloatsEqual(ComputedHeight, other.ComputedHeight); } return(isEqual); }
public override int GetHashCode() { unchecked { var hashCode = AvailableHeight.GetHashCode(); hashCode = (hashCode * 397) ^ AvailableWidth.GetHashCode(); hashCode = (hashCode * 397) ^ ComputedHeight.GetHashCode(); hashCode = (hashCode * 397) ^ ComputedWidth.GetHashCode(); hashCode = (hashCode * 397) ^ (int)HeightMeasureMode; hashCode = (hashCode * 397) ^ (int)WidthMeasureMode; return(hashCode); } }
/// <inheritdoc /> public bool Equals(CachedMeasurement other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (AvailableHeight.Equals(other.AvailableHeight) && AvailableWidth.Equals(other.AvailableWidth) && ComputedHeight.Equals(other.ComputedHeight) && ComputedWidth.Equals(other.ComputedWidth) && HeightMeasureMode == other.HeightMeasureMode && WidthMeasureMode == other.WidthMeasureMode); }