Example #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Gets an enumeration associated with the given numeric type
		/// </summary>
		/// <param name="numericType">Type of the numeric.</param>
		/// <returns>
		/// Returns the only instance that matches the requested value.
		/// Thus two calls will get the same instance.
		/// </returns>
		/// ------------------------------------------------------------------------------------
		public static UcdProperty GetInstance(Icu.UNumericType numericType)
		{
			InitializeHashTables();
			Dictionary<int, UcdProperty> propertyHash = s_ucdPropertyDict[UcdCategories.numericType];
			return propertyHash[(int)numericType];
		}
Example #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Gets an enumeration associated with the given Compatability Decomposition Type
		/// </summary>
		/// <param name="decompositionType">The compatability decomposition type</param>
		/// <returns>
		/// Returns the only instance that matches the requested value.
		/// Thus two calls will get the same instance.
		/// </returns>
		/// ------------------------------------------------------------------------------------
		public static UcdProperty GetInstance(Icu.UDecompositionType decompositionType)
		{
			InitializeHashTables();
			Dictionary<int, UcdProperty> propertyHash = s_ucdPropertyDict[UcdCategories.compatabilityDecompositionType];
			return propertyHash[(int)decompositionType];
		}
		private string GetLanguageCountry(Icu.Locale locale)
		{
			if (string.IsNullOrEmpty(locale.Country) && string.IsNullOrEmpty(locale.Language))
				return string.Empty;
			return locale.Language + "_" + locale.Country;
		}
Example #4
0
		/// <summary>
		/// Initializes a new instance of the <see cref="CollationRuleException"/> class.
		/// </summary>
		/// <param name="errorCode">The ICU error code.</param>
		/// <param name="errorInfo">The error information.</param>
		public CollationRuleException(Icu.UErrorCode errorCode, CollationRuleErrorInfo errorInfo)
			: base("Failed to parse collation rules.", errorCode)
		{
			m_errorInfo = errorInfo;
		}
Example #5
0
		internal CollationRuleErrorInfo(Icu.UParseError parseError)
		{
			Line = parseError.line + 1;
			Offset = parseError.offset + 1;
			PreContext = parseError.preContext;
			PostContext = parseError.postContext;
		}
Example #6
0
		/// <summary>
		/// Initializes a new instance of the <see cref="IcuException"/> class.
		/// </summary>
		/// <param name="message">The message.</param>
		/// <param name="errorCode">The error code.</param>
		public IcuException(string message, Icu.UErrorCode errorCode)
			: base(message)
		{
			m_errorCode = errorCode;
		}