Sdílet prostřednictvím


GeographicRegion Class

Definition

Describes a region. This is usually a country, but may be a macroregion.

public ref class GeographicRegion sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.IGeographicRegionFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class GeographicRegion final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.IGeographicRegionFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class GeographicRegion final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.IGeographicRegionFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class GeographicRegion
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.IGeographicRegionFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class GeographicRegion
function GeographicRegion(geographicRegionCode)
Public NotInheritable Class GeographicRegion
Inheritance
Object Platform::Object IInspectable GeographicRegion
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Examples

// Get the user's geographic region and its display name.
var geographicRegion = new Windows.Globalization.GeographicRegion();
var displayName = geographicRegion.DisplayName;

Remarks

For a list of standard country/region codes used by Microsoft, see the Official Country/Region List.

Constructors

GeographicRegion()

Creates a GeographicRegion object that defaults to the user's home region.

GeographicRegion(String)

Creates a GeographicRegion object.

Properties

Code

Gets the string that contains the best available identifier that represents the region.

CodeThreeDigit

Gets the three-digit identifier for this region, as a string.

CodeThreeLetter

Gets the three-letter identifier for this region.

CodeTwoLetter

Gets the two-letter identifier for this region.

CurrenciesInUse

Gets the set of currencies in use in this region.

DisplayName

Gets a localized string that is suitable for display to the user for identifying the region.

NativeName

Gets the name of the region in the primary language spoken in this region.

Methods

IsSupported(String)

Determines whether a geographic region identifier is supported.

Applies to

See also