Exemplo n.º 1
0
 public override bool Equals(object obj)
 {
     // TODO-Linux: System.Boolean System.Type::op_Inequality(System.Type,System.Type) is
     // marked with a [MonoTODO] attribute and might not work as expected in 4.0
     if (obj.GetType() != this.GetType())
     {
         return(false);
     }
     else
     {
         UcdProperty ucdEnum = (UcdProperty)obj;
         return
             (this.m_description == ucdEnum.m_description &&
              this.m_ucdRepresentation == ucdEnum.m_ucdRepresentation &&
              this.m_ucdCategory == ucdEnum.m_ucdCategory);
     }
 }
Exemplo n.º 2
0
		/// <summary>
		/// Update this PUA character to match the codepoint in ICU.
		/// </summary>
		/// <returns>Whether the character was completely loaded from Icu.</returns>
		public bool RefreshFromIcu(bool loadBlankNames)
		{
			InitTheCom();

			if(!Icu.IsValidCodepoint(m_codepoint))
				return false;

			// use the codepoint
			int parsedCodepoint = Character;

			// set the name
			Icu.UErrorCode error;
			Icu.UCharNameChoice choice = Icu.UCharNameChoice.U_UNICODE_CHAR_NAME;
			Icu.u_CharName(parsedCodepoint, choice, out m_name, out error);

			// Don't load blank names, unless requested to.
			if(!loadBlankNames && m_name.Length <= 0)
				return false;

			// Set several properties
			m_generalCategory =
				UcdProperty.GetInstance(s_charPropEngine.get_GeneralCategory(parsedCodepoint));
			m_canonicalCombiningClass =
				UcdProperty.GetInstance(s_charPropEngine.get_CombiningClass(parsedCodepoint));
			m_bidiClass =UcdProperty.GetInstance(s_charPropEngine.get_BidiCategory(parsedCodepoint));

			m_decomposition = ConvertToHexString(s_charPropEngine.get_Decomposition(parsedCodepoint));
			m_decompositionType = Icu.GetDecompositionType(parsedCodepoint);
			m_numericType = Icu.GetNumericType(parsedCodepoint);
			if( m_numericType != UcdProperty.GetInstance(Icu.UNumericType.U_NT_NONE) )
				m_numericValue = decimalToFraction(Icu.u_GetNumericValue(parsedCodepoint));
			else
				m_numericValue = "";

			// Set the bidi mirrored
			BidiMirrored = Icu.u_IsMirrored(parsedCodepoint);

			// Set upper, lower, and title
			m_upper = PUACharacter.ConvertToHexString(s_charPropEngine.get_ToUpperCh(parsedCodepoint));
			m_lower = PUACharacter.ConvertToHexString(s_charPropEngine.get_ToLowerCh(parsedCodepoint));
			m_title = PUACharacter.ConvertToHexString(s_charPropEngine.get_ToTitleCh(parsedCodepoint));

			// We don't have to do the following (if they already exist, we may delete the values)
			//unicode1Name
			m_isoComment = s_charPropEngine.get_Comment(parsedCodepoint);

			return true;
		}
Exemplo n.º 3
0
		/// <summary>
		/// Copy data from the given PUACharacter
		/// </summary>
		/// <param name="sourceIPuaChar">The character to copy.</param>
		public void Copy(IPuaCharacter sourceIPuaChar)
		{
			PUACharacter sourcePuaChar = (PUACharacter)sourceIPuaChar;
			this.CodePoint = sourcePuaChar.m_codepoint;
			this.Name = sourcePuaChar.m_name;
			this.m_generalCategory = sourcePuaChar.m_generalCategory;
			this.m_canonicalCombiningClass = sourcePuaChar.m_canonicalCombiningClass;
			this.m_bidiClass = sourcePuaChar.m_bidiClass;
			this.m_decompositionType = sourcePuaChar.m_decompositionType;
			this.m_decomposition = sourcePuaChar.m_decomposition;
			this.m_numericType = sourcePuaChar.m_numericType;
			this.m_numericValue = sourcePuaChar.m_numericValue;
			this.m_bidiMirrored = sourcePuaChar.m_bidiMirrored;
			this.m_unicode1Name = sourcePuaChar.m_unicode1Name;
			this.m_isoComment = sourcePuaChar.m_isoComment;
			this.m_upper = sourcePuaChar.m_upper;
			this.m_lower = sourcePuaChar.m_lower;
			this.m_title = sourcePuaChar.m_title;
		}