コード例 #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ LeftPercent.GetHashCode();
         hashCode = (hashCode * 397) ^ TopPercent.GetHashCode();
         hashCode = (hashCode * 397) ^ WidthPercent.GetHashCode();
         hashCode = (hashCode * 397) ^ HeightPercent.GetHashCode();
         hashCode = (hashCode * 397) ^ IsCustom.GetHashCode();
         return(hashCode);
     }
 }
コード例 #2
0
 public bool Equals(Placement other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(string.Equals(Name, other.Name) &&
            LeftPercent.Equals(other.LeftPercent) &&
            TopPercent.Equals(other.TopPercent) &&
            WidthPercent.Equals(other.WidthPercent) &&
            HeightPercent.Equals(other.HeightPercent) &&
            IsCustom == other.IsCustom);
 }