예제 #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");
		}