예제 #1
0
 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);
     }
 }
예제 #2
0
        /// <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);
        }