GeographicRegion
GeographicRegion
GeographicRegion
GeographicRegion
Class
Definition
Describes a region. This is usually a country, but may be a macroregion.
public : sealed class GeographicRegion : IGeographicRegionpublic sealed class GeographicRegion : IGeographicRegionPublic NotInheritable Class GeographicRegion Implements IGeographicRegion// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Examples
// Get the user's geographic region and its display name.
var geographicRegion = new Windows.Globalization.GeographicRegion;
var displayName = geographicRegion.displayName;
// Get the user's geographic region and its display name.
var geographicRegion = new Windows.Globalization.GeographicRegion();
var displayName = geographicRegion.DisplayName;
Constructors
GeographicRegion() GeographicRegion() GeographicRegion() GeographicRegion()
Creates a GeographicRegion object that defaults to the user's home region.
public : GeographicRegion()public GeographicRegion()Public Sub New()// You can use this method in JavaScript.
- See Also
GeographicRegion(String) GeographicRegion(String) GeographicRegion(String) GeographicRegion(String)
Creates a GeographicRegion object.
public : GeographicRegion(PlatForm::String geographicRegionCode)public GeographicRegion(String geographicRegionCode)Public Sub New(geographicRegionCode As String)// You can use this method in JavaScript.
- geographicRegionCode
- PlatForm::String String String String
One of the ISO 3166-1 two-letter or three-letter codes that identify the country, or one of the three-digit UN-M49 codes that identify the geographical region.
Properties
Code Code Code Code
Gets the string that contains the best available identifier that represents the region.
public : PlatForm::String Code { get; }public string Code { get; }Public ReadOnly Property Code As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
Returns a string that contains:
- The two-letter identifier code, if one exists (and is not "ZZ");
- otherwise, the three-letter identifier code, if one exists (and is not "ZZZ");
- otherwise, the three-digit numeric identifier code, if one exists (and is not "999");
- otherwise, "ZZ".
CodeThreeDigit CodeThreeDigit CodeThreeDigit CodeThreeDigit
Gets the three-digit identifier for this region, as a string.
public : PlatForm::String CodeThreeDigit { get; }public string CodeThreeDigit { get; }Public ReadOnly Property CodeThreeDigit As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
Returns as a string the ISO-3166-1 numeric three-digit code for the region, or the UN-M49 code. If the region is unknown, returns "999".
CodeThreeLetter CodeThreeLetter CodeThreeLetter CodeThreeLetter
Gets the three-letter identifier for this region.
public : PlatForm::String CodeThreeLetter { get; }public string CodeThreeLetter { get; }Public ReadOnly Property CodeThreeLetter As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
Returns the three-letter ISO 3166-1 alpha-3 code for this region, if one exists; otherwise, returns "ZZZ".
CodeTwoLetter CodeTwoLetter CodeTwoLetter CodeTwoLetter
Gets the two-letter identifier for this region.
public : PlatForm::String CodeTwoLetter { get; }public string CodeTwoLetter { get; }Public ReadOnly Property CodeTwoLetter As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
Returns the two-letter ISO 3166-1 alpha-2 code for this region, if one exists; otherwise, returns "ZZ".
CurrenciesInUse CurrenciesInUse CurrenciesInUse CurrenciesInUse
Gets the set of currencies in use in this region.
public : IVectorView<string> CurrenciesInUse { get; }public IReadOnlyList<string> CurrenciesInUse { get; }Public ReadOnly Property CurrenciesInUse As IReadOnlyList<string>// You can use this property in JavaScript.
- Value
- IVectorView<PlatForm::String> IReadOnlyList<string> IReadOnlyList<string> IReadOnlyList<string>
The set of ISO 4217 3-letter codes for the currencies that are used in the region.
Remarks
If the region is a country, there is typically one currency, although some countries do have more than one currency in use. If the region is larger, the returned set includes the currencies in use in each of the contained regions/countries.
DisplayName DisplayName DisplayName DisplayName
Gets a localized string that is suitable for display to the user for identifying the region.
public : PlatForm::String DisplayName { get; }public string DisplayName { get; }Public ReadOnly Property DisplayName As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The localized name of the region.
NativeName NativeName NativeName NativeName
Gets the name of the region in the primary language spoken in this region.
public : PlatForm::String NativeName { get; }public string NativeName { get; }Public ReadOnly Property NativeName As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The name of the region in the primary language spoken in this region.
Methods
IsSupported(String) IsSupported(String) IsSupported(String) IsSupported(String)
Determines whether a geographic region identifier is supported.
public : static PlatForm::Boolean IsSupported(PlatForm::String geographicRegionCode)public static bool IsSupported(String geographicRegionCode)Public Static Function IsSupported(geographicRegionCode As String) As bool// You can use this method in JavaScript.
- geographicRegionCode
- PlatForm::String String String String
One of the ISO 3166-1 two-letter or three-letter codes that identify the country, or one of the three-digit UN-M49 codes that identify the geographical region.
True if the ID is known; otherwise, ** false. If this method returns **true, an app can safely construct a region by using this region identifier. If it returns false, attempting to construct a region for the given code will throw an exception.