示例#1
0
		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
		}
示例#2
0
文件: Font.cs 项目: wincc0823/mono
        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);
        }
示例#3
0
 public override int GetHashCode()
 {
     return(_name.GetHashCode() ^ FontFamily.GetHashCode() ^ _size.GetHashCode() ^ _style.GetHashCode() ^
            _gdiCharSet ^ _gdiVerticalFont.GetHashCode());
 }
示例#4
0
		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");
		}