private void CheckMono (FontFamily ff) { Assert.IsTrue (ff.Equals (FontFamily.GenericMonospace), "GenericMonospace"); #if NET_2_0 // note: Mono has this behaviour on both 1.1 and 2.0 profiles Assert.AreEqual (ff.Name.GetHashCode (), ff.GetHashCode (), "GetHashCode"); #endif }
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); }
public override int GetHashCode() { return(_name.GetHashCode() ^ FontFamily.GetHashCode() ^ _size.GetHashCode() ^ _style.GetHashCode() ^ _gdiCharSet ^ _gdiVerticalFont.GetHashCode()); }
public void FontFamily_Serif () { FontFamily ff = new FontFamily (GenericFontFamilies.Serif); Assert.IsTrue (ff.Equals (FontFamily.GenericSerif), "GenericSerif"); // note: Mono has this behaviour on both 1.1 and 2.0 profiles Assert.AreEqual (ff.Name.GetHashCode (), ff.GetHashCode (), "GetHashCode"); }