Exemplo n.º 1
0
 /// <summary>Returns the value of the criteria as a string.</summary>
 /// <returns>The object as a string.</returns>
 public override string ToString()
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder(128);
     sb.Append("Comparison criteria definition.");
     sb.Append("\r\nMinColorDistance: ");
     sb.Append(MinColorDistance.ToString());
     sb.Append("\r\nMinColorContrast: ");
     sb.Append(MinColorContrast.ToString());
     sb.Append("\r\nMinBrightnessDistance: ");
     sb.Append(MinBrightnessDistance.ToString());
     sb.Append("\r\nMinBrightnessContrast: ");
     sb.Append(MinBrightnessContrast.ToString());
     sb.Append("\r\nMaxColorDistance: ");
     sb.Append(MaxColorDistance.ToString());
     sb.Append("\r\nMaxColorContrast: ");
     sb.Append(MaxColorContrast.ToString());
     sb.Append("\r\nMaxBrightnessDistance: ");
     sb.Append(MaxBrightnessDistance.ToString());
     sb.Append("\r\nMaxBrightnessContrast: ");
     sb.Append(MaxBrightnessContrast.ToString());
     sb.Append("\r\nMaxPixelDistance: ");
     sb.Append(MaxPixelDistance.ToString());
     sb.Append("\r\nMaxErrorProportion: ");
     sb.Append(MaxErrorProportion.ToString());
     return(sb.ToString());
 }
Exemplo n.º 2
0
 /// <summary>Returns a hash code for the class.</summary>
 /// <remarks>This is quite shoddy. It is just meant to base the
 /// hashing on values instead of identities, as required by the
 /// fact that the Equals operation is being overridden too.</remarks>
 /// <returns>A hash value.</returns>
 public override int GetHashCode()
 {
     return
         (MinColorDistance.GetHashCode()
          ^ MinBrightnessDistance.GetHashCode()
          ^ MaxColorDistance.GetHashCode()
          ^ MaxPixelDistance);
 }