/// <include file='doc\RegionInfo.uex' path='docs/doc[@for="RegionInfo.RegionInfo1"]/*' />
public RegionInfo(int culture)
{
// Get the culture data item.
int cultureItem = CultureTable.GetDataItemFromCultureID(CultureInfo.GetLangID(culture));
if (cultureItem < 0)
{
// Not a valid culture ID.
throw new ArgumentException(Environment.GetResourceString("Argument_CultureNotSupported", culture), "culture");
}
if (culture == 0x7F) //The InvariantCulture has no matching region
{
throw new ArgumentException(Environment.GetResourceString("Argument_NoRegionInvariantCulture"));
}
//
// From this culture data item, get the region data item.
// We do this because several culture ID may map to the same region.
// For example, 0x1009 (English (Canada)) and 0x0c0c (French (Canada)) all map to
// the same region "CA" (Canada).
//
m_dataItem = CultureTable.GetDefaultInt32Value(cultureItem, CultureTable.IREGIONITEM);
if (m_dataItem == 0xffff)
{
throw new ArgumentException(Environment.GetResourceString("Argument_CultureIsNeutral", culture), "culture");
}
}