Example #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;
         hashCode = hashCode * 59 + TextVerticalAlignment.GetHashCode();
         hashCode = hashCode * 59 + TextHorizontalAlignment.GetHashCode();
         if (Text != null)
         {
             hashCode = hashCode * 59 + Text.GetHashCode();
         }
         if (TextColor != null)
         {
             hashCode = hashCode * 59 + TextColor.GetHashCode();
         }
         if (FontName != null)
         {
             hashCode = hashCode * 59 + FontName.GetHashCode();
         }
         hashCode = hashCode * 59 + StandardFontName.GetHashCode();
         hashCode = hashCode * 59 + FontStyle.GetHashCode();
         hashCode = hashCode * 59 + FontSize.GetHashCode();
         return(hashCode);
     }
 }
Example #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Family.Length != 0)
            {
                hash ^= Family.GetHashCode();
            }
            if (FontStyle != 0)
            {
                hash ^= FontStyle.GetHashCode();
            }
            if (Size != 0)
            {
                hash ^= Size.GetHashCode();
            }
            if (SizeUnit != 0)
            {
                hash ^= SizeUnit.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Example #3
0
 private Int32 Hash(FontFamily ff, FontStyle style, FontWeight weight, FontStretch stretch)
 {
     unchecked
     {
         return(ff.GetHashCode() + style.GetHashCode() * 1229 + weight.GetHashCode() * 20011 + stretch.GetHashCode() * 200003);
     }
 }
Example #4
0
        public override int GetHashCode()
        {
            var nameHash  = _name == null? 0: _name.GetHashCode();
            var sizeHash  = _size.GetHashCode();
            var styleHash = _style.GetHashCode();
            var unitHash  = _unit.HasValue? _unit.Value.GetHashCode(): 0;

            return(nameHash ^ sizeHash ^ styleHash ^ unitHash);
        }
Example #5
0
 /// <summary>
 /// Serves as a hash function for a <see cref="Candlelight.RichTextStyle"/> object.
 /// </summary>
 /// <returns>
 /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
 /// hash table.
 /// </returns>
 public override int GetHashCode()
 {
     return(ObjectX.GenerateHashCode(
                m_SizeScalar.GetHashCode(),
                m_FontStyle.GetHashCode(),
                m_ShouldReplaceColor.GetHashCode(),
                m_ReplacementColor.GetHashCode()
                ));
 }
Example #6
0
        public override int GetHashCode()
        {
            var hashCode = -1203003344;

            hashCode = hashCode * -1521134295 + foreColor.GetHashCode();
            hashCode = hashCode * -1521134295 + backColor.GetHashCode();
            hashCode = hashCode * -1521134295 + fontStyle.GetHashCode();
            return(hashCode);
        }
Example #7
0
 /// <summary>
 /// ハッシュ値を計算します。
 /// </summary>
 public override int GetHashCode()
 {
     return(
         FontFamilyName.GetHashCode() ^
         FontStyle.GetHashCode() ^
         Size.GetHashCode() ^
         Color.GetHashCode() ^
         EdgeColor.GetHashCode() ^
         EdgeLength.GetHashCode() ^
         IsStretchSize.GetHashCode());
 }
Example #8
0
        public override int GetHashCode()
        {
            var hashCode = 577408457;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(FontFamily);

            hashCode = hashCode * -1521134295 + FontWeight.GetHashCode();
            hashCode = hashCode * -1521134295 + FontStyle.GetHashCode();
            hashCode = hashCode * -1521134295 + Size.GetHashCode();
            return(hashCode);
        }
Example #9
0
        public override int GetHashCode()
        {
            var hashCode = -23843572;

            hashCode = hashCode * -1521134295 + EqualityComparer <string?> .Default.GetHashCode(Path);

            hashCode = hashCode * -1521134295 + EqualityComparer <Stream?> .Default.GetHashCode(Stream);

            hashCode = hashCode * -1521134295 + Size.GetHashCode();
            hashCode = hashCode * -1521134295 + FontStyle.GetHashCode();
            return(hashCode);
        }
Example #10
0
        /// <summary>
        /// Gets a font with specified settings.
        /// </summary>
        /// <param name="name">Name of a font.</param>
        /// <param name="size">Size of a font.</param>
        /// <param name="style">Style of a font.</param>
        /// <returns>The <b>Font</b> object.</returns>
        public Font GetFont(string name, float size, FontStyle style)
        {
            int  hash   = name.GetHashCode() ^ size.GetHashCode() ^ style.GetHashCode();
            Font result = FFonts[hash] as Font;

            if (result == null)
            {
                result       = new Font(name, size, style);
                FFonts[hash] = result;
            }
            return(result);
        }
Example #11
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         hashCode = hashCode * 59 + FontStyle.GetHashCode();
         if (FamilyName != null)
         {
             hashCode = hashCode * 59 + FamilyName.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #12
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = fontFamily?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (fontSize?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (fontWeight?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (fontStyle?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (height?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (leading?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ forceStrutHeight.GetHashCode();
         return(hashCode);
     }
 }
Example #13
0
            private int ComputeHash()
            {
                var hash = 27;

                if (Name != null)
                {
                    hash = hash * 486187739 + Name.GetHashCode();
                }
                hash = hash * 486187739 + _sizeEquality.GetHashCode();
                hash = hash * 486187739 + Style.GetHashCode();
                hash = hash * 486187739 + Unit.GetHashCode();
                return(hash);
            }
Example #14
0
            public override int GetHashCode()
            {
                var hash = 0x75417862;

                if (Name != null)
                {
                    hash ^= Name.GetHashCode();
                }
                hash ^= Size.GetHashCode();
                hash ^= Style.GetHashCode();
                hash ^= Unit.GetHashCode();
                return(hash);
            }
        /// <summary>
        /// Create correspondent hash code for the object
        /// </summary>
        /// <returns>object hash code</returns>
        public override int GetHashCode()
        {
            int hash = _fontFamily.GetHashCode();

            if (_fallbackFontFamily != null)
            {
                hash = HashFn.HashMultiply(hash) + _fallbackFontFamily.GetHashCode();
            }

            hash = HashFn.HashMultiply(hash) + _style.GetHashCode();
            hash = HashFn.HashMultiply(hash) + _weight.GetHashCode();
            hash = HashFn.HashMultiply(hash) + _stretch.GetHashCode();
            return(HashFn.HashScramble(hash));
        }
Example #16
0
        public override int GetHashCode()
        {
            if (_hashCode == 0)
            {
                _hashCode = 17;
                unchecked {
                    _hashCode = _hashCode * 23 + _name.GetHashCode();
                    _hashCode = _hashCode * 23 + FontFamily.GetHashCode();
                    _hashCode = _hashCode * 23 + _size.GetHashCode();
                    _hashCode = _hashCode * 23 + _unit.GetHashCode();
                    _hashCode = _hashCode * 23 + _style.GetHashCode();
                    _hashCode = _hashCode * 23 + _gdiCharSet;
                    _hashCode = _hashCode * 23 + _gdiVerticalFont.GetHashCode();
                }
            }

            return(_hashCode);
        }
Example #17
0
        protected override int ComputeHashCode()
        {
            var hash = text.GetHashCode();

            //if (font != null)
            //{
            //    hash = hash * 37 + font.GetHashCode();
            //}
            hash = hash * 37 + fontSize.GetHashCode();
            hash = hash * 37 + fontStyle.GetHashCode();
            hash = hash * 37 + lineSpacing.GetHashCode();
            hash = hash * 37 + supportRichText.GetHashCode();
            hash = hash * 37 + alignment.GetHashCode();
            hash = hash * 37 + alignByGeometry.GetHashCode();
            hash = hash * 37 + horizontalOverflow.GetHashCode();
            hash = hash * 37 + verticalOverflow.GetHashCode();
            hash = hash * 37 + resizeTextForBestFit.GetHashCode();
            hash = hash * 37 + maskable.GetHashCode();
            return(hash);
        }
Example #18
0
 private int GetKey(Color foreground, Color background, FontStyle style)
 {
     return((((foreground.GetHashCode() * 397) ^ background.GetHashCode()) * 397) ^ style.GetHashCode());
 }
Example #19
0
 /// <summary>
 /// Serves as a hash function for a <see cref="Eto.Drawing.Font"/> object.
 /// </summary>
 /// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.</returns>
 public override int GetHashCode()
 {
     return(FamilyName.GetHashCode() ^ Platform.GetHashCode() ^ Size.GetHashCode() ^ FontStyle.GetHashCode());
 }
Example #20
0
 public override int GetHashCode()
 {
     return(_name.GetHashCode() ^ FontFamily.GetHashCode() ^ _size.GetHashCode() ^ _style.GetHashCode() ^
            _gdiCharSet ^ _gdiVerticalFont.GetHashCode());
 }
Example #21
0
 public int GetHashCode(StyleLookup obj)
 {
     return((padding.GetHashCode() + fontSize.GetHashCode() + fontStyle.GetHashCode() + color.GetHashCode()) ^
            (padding.GetHashCode() * fontSize.GetHashCode() * fontStyle.GetHashCode() * color.GetHashCode()));
 }
 public override int GetHashCode()
 {
     unchecked {
         return((Name != null ? Name.GetHashCode() : 0) ^ Foreground.GetHashCode() ^ Background.GetHashCode() ^ FontWeight.GetHashCode() ^ FontStyle.GetHashCode());
     }
 }
Example #23
0
 public override int GetHashCode()
 {
     return(Color.GetHashCode() ^ ButtonColor.GetHashCode() ^ ColorChanged.GetHashCode() ^ FontStyle.GetHashCode() ^ Fontname.GetHashCode());
 }
Example #24
0
 public override int GetHashCode()
 {
     return(unchecked (FontFamily.GetHashCode() + Size.GetHashCode() + FontStyle.GetHashCode()));
 }
Example #25
0
 /// <summary>
 /// Serves as a hash function for a <see cref="Eto.Drawing.Font"/> object.
 /// </summary>
 /// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.</returns>
 public override int GetHashCode()
 {
     return(FamilyName.GetHashCode() ^ Generator.GetHashCode() ^ Size.GetHashCode() ^ FontStyle.GetHashCode());
 }
Example #26
0
 public override int GetHashCode()
 {
     return(Family.GetHashCode() + Style.GetHashCode());
 }
Example #27
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     return(FontFamily.Source.GetHashCode() ^ FontSize.GetHashCode() ^ FontStyle.GetHashCode() ^ FontWeight.GetHashCode());
 }
Example #28
0
 public override int GetHashCode()
 {
     return(unchecked (family.GetHashCode() + size.GetHashCode() + style.GetHashCode()));
 }