示例#1
0
 internal static int GetLocaleDataNumericPart(string cultureName, LocaleDataParts part)
 {
     int index = SearchCultureName(cultureName);
     if (index < 0)
     {
         return -1; 
     }
     
     Contract.Assert((s_localeNamesIndices.Length-1 == (s_nameIndexToNumericData.Length/NUMERIC_LOCALE_DATA_COUNT_PER_ROW)) && 
                     index < s_localeNamesIndices.Length);
     
     return s_nameIndexToNumericData[index * NUMERIC_LOCALE_DATA_COUNT_PER_ROW + (int) part];
 }
示例#2
0
 internal static string GetLocaleDataMappedCulture(string cultureName, LocaleDataParts part)
 {
     int indexToIndicesTable = GetLocaleDataNumericPart(cultureName, part);
     if (indexToIndicesTable < 0)
     {
         return ""; // fallback to invariant
     }
     
     Debug.Assert(indexToIndicesTable < s_localeNamesIndices.Length-1);
     
     return c_localeNames.Substring(s_localeNamesIndices[indexToIndicesTable], 
                                    s_localeNamesIndices[indexToIndicesTable+1] - s_localeNamesIndices[indexToIndicesTable]);
 }