Example #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Typeface != null ? Typeface.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ FontRenderingEmSize.GetHashCode();
         return(hashCode);
     }
 }
Example #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Typeface != null ? Typeface.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ FontRenderingEmSize.GetHashCode();
         hashCode = (hashCode * 397) ^ (TextDecorations != null ? TextDecorations.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ForegroundBrush != null ? ForegroundBrush.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (BackgroundBrush != null ? BackgroundBrush.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CultureInfo != null ? CultureInfo.GetHashCode() : 0);
         return(hashCode);
     }
 }
Example #3
0
        public bool Equals(TextRunProperties other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(Typeface.Equals(other.Typeface) &&
                   FontRenderingEmSize.Equals(other.FontRenderingEmSize) &&
                   Equals(TextDecorations, other.TextDecorations) &&
                   Equals(ForegroundBrush, other.ForegroundBrush) &&
                   Equals(BackgroundBrush, other.BackgroundBrush) &&
                   Equals(CultureInfo, other.CultureInfo));
        }
Example #4
0
 public bool Equals(TextFormat other)
 {
     return(Typeface.Equals(other.Typeface) && FontRenderingEmSize.Equals(other.FontRenderingEmSize));
 }