コード例 #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Col != null)
         {
             hashCode = hashCode * 59 + Col.GetHashCode();
         }
         if (Row != null)
         {
             hashCode = hashCode * 59 + Row.GetHashCode();
         }
         if (SizeX != null)
         {
             hashCode = hashCode * 59 + SizeX.GetHashCode();
         }
         if (SizeY != null)
         {
             hashCode = hashCode * 59 + SizeY.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Options != null)
         {
             hashCode = hashCode * 59 + Options.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
 public override int GetHashCode()
 {
     if (IsEmpty)
     {
         return(0);
     }
     else
     {
         // Perform field-by-field XOR of HashCodes
         return(X.GetHashCode() ^
                Y.GetHashCode() ^
                Z.GetHashCode() ^
                SizeX.GetHashCode() ^
                SizeY.GetHashCode() ^
                SizeZ.GetHashCode());
     }
 }
コード例 #3
0
ファイル: Image.cs プロジェクト: trmcnealy/Plotly.WPF
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Visible != null)
                {
                    hashCode = hashCode * 59 + Visible.GetHashCode();
                }

                if (Source != null)
                {
                    hashCode = hashCode * 59 + Source.GetHashCode();
                }

                if (Layer != null)
                {
                    hashCode = hashCode * 59 + Layer.GetHashCode();
                }

                if (SizeX != null)
                {
                    hashCode = hashCode * 59 + SizeX.GetHashCode();
                }

                if (SizeY != null)
                {
                    hashCode = hashCode * 59 + SizeY.GetHashCode();
                }

                if (Sizing != null)
                {
                    hashCode = hashCode * 59 + Sizing.GetHashCode();
                }

                if (Opacity != null)
                {
                    hashCode = hashCode * 59 + Opacity.GetHashCode();
                }

                if (X != null)
                {
                    hashCode = hashCode * 59 + X.GetHashCode();
                }

                if (Y != null)
                {
                    hashCode = hashCode * 59 + Y.GetHashCode();
                }

                if (XAnchor != null)
                {
                    hashCode = hashCode * 59 + XAnchor.GetHashCode();
                }

                if (YAnchor != null)
                {
                    hashCode = hashCode * 59 + YAnchor.GetHashCode();
                }

                if (XRef != null)
                {
                    hashCode = hashCode * 59 + XRef.GetHashCode();
                }

                if (YRef != null)
                {
                    hashCode = hashCode * 59 + YRef.GetHashCode();
                }

                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }

                if (TemplateItemName != null)
                {
                    hashCode = hashCode * 59 + TemplateItemName.GetHashCode();
                }

                return(hashCode);
            }
        }
コード例 #4
0
 public override int GetHashCode() => X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode() ^ SizeX.GetHashCode() ^ SizeY.GetHashCode() ^ SizeZ.GetHashCode();