Пример #1
0
 /// <summary>
 /// Check a binary Unicode property for a code point.
 /// Unicode, especially in version 3.2, defines many more properties than the original set in UnicodeData.txt.
 /// The properties APIs are intended to reflect Unicode properties as defined in the Unicode Character Database (UCD) and Unicode Technical Reports (UTR). For details about the properties see http://www.unicode.org/ucd/ . For names of Unicode properties see the UCD file PropertyAliases.txt.
 /// Important: If ICU is built with UCD files from Unicode versions below 3.2, then properties marked with "new in Unicode 3.2" are not or not fully available.
 /// </summary>
 /// <param name="characterCode">Code point to test. </param>
 /// <param name="which">UProperty selector constant, identifies which binary property to check. Must be UCHAR_BINARY_START&lt;=which&lt;UCHAR_BINARY_LIMIT. </param>
 /// <returns>TRUE or FALSE according to the binary Unicode property value for c. Also FALSE if 'which' is out of bounds or if the Unicode version does not have data for the property at all, or not for this code point.</returns>
 /// <exception cref="ArgumentOutOfRangeException">Thrown when <paramref name="which"/> does not meet the requirement UCHAR_BINARY_START&lt;=which&lt;UCHAR_BINARY_LIMIT.</exception>
 public static bool HasBinaryProperty(int characterCode, UProperty which)
 {
     if (which < UProperty.BINARY_START || which >= UProperty.BINARY_LIMIT)
     {
         throw new ArgumentOutOfRangeException(nameof(characterCode));
     }
     return(NativeMethods.u_hasBinaryProperty(characterCode, which));
 }