Class StatisticalRegionInfo
- Namespace
- Cuemon.Globalization
- Assembly
- Cuemon.Core.dll
Represents a geographic region or country as defined by the UN M.49 standard.
public sealed class StatisticalRegionInfo
- Inheritance
-
StatisticalRegionInfo
Remarks
UN M.49 is a standard for representing country and area codes for statistical use. This class provides a unified view of the hierarchy, treating countries as leaf nodes in the region tree. Each instance has a Kind that identifies its level in the hierarchy (World, Region, Subregion, IntermediateRegion, or CountryOrTerritory). Source: https://unstats.un.org/unsd/methodology/m49/
Properties
Children
Gets the direct child regions or countries of this region.
public IEnumerable<StatisticalRegionInfo> Children { get; }
Property Value
- IEnumerable<StatisticalRegionInfo>
An enumerable list of children. Empty list if this is a leaf node (country).
Code
Gets the UN M.49 numeric code for this region or country.
public string Code { get; }
Property Value
- string
The three-digit UN M.49 code (e.g., "001" for World, "840" for United States).
Countries
Gets all countries in this geographic region.
public IEnumerable<StatisticalRegionInfo> Countries { get; }
Property Value
- IEnumerable<StatisticalRegionInfo>
An enumerable list of child regions where Kind is CountryOrTerritory.
Remarks
This is a convenience property that filters Children to return only countries. It recursively includes all descendant countries, not just immediate children.
IsLandLockedDevelopingCountry
Gets a value indicating whether this country is classified as a Land Locked Developing Country (LLDC).
public bool IsLandLockedDevelopingCountry { get; }
Property Value
- bool
trueif this is an LLDC; otherwise,false. Alwaysfalsefor non-countries.
IsLeastDevelopedCountry
Gets a value indicating whether this country is classified as a Least Developed Country (LDC).
public bool IsLeastDevelopedCountry { get; }
Property Value
- bool
trueif this is an LDC; otherwise,false. Alwaysfalsefor non-countries.
IsSmallIslandDevelopingState
Gets a value indicating whether this country is classified as a Small Island Developing State (SIDS).
public bool IsSmallIslandDevelopingState { get; }
Property Value
- bool
trueif this is a SIDS; otherwise,false. Alwaysfalsefor non-countries.
IsoAlpha2
Gets the ISO 3166-1 alpha-2 code for this country.
public string IsoAlpha2 { get; }
Property Value
- string
The two-letter ISO code (e.g., "US", "DE"), or
nullif this is not a country.
IsoAlpha3
Gets the ISO 3166-1 alpha-3 code for this country.
public string IsoAlpha3 { get; }
Property Value
- string
The three-letter ISO code (e.g., "USA", "DEU"), or
nullif this is not a country.
Kind
Gets the kind of this statistical region.
public StatisticalRegionKind Kind { get; }
Property Value
- StatisticalRegionKind
A StatisticalRegionKind value indicating the hierarchy level.
Name
Gets the official UN name of this region or country.
public string Name { get; }
Property Value
- string
The name (e.g., "World", "Europe", "United States of America").
Parent
Gets the parent region in the UN M.49 hierarchy.
public StatisticalRegionInfo Parent { get; }
Property Value
- StatisticalRegionInfo
The parent region, or
nullif this is the World region (code "001").
Region
Gets the .NET RegionInfo for this country if available.
public RegionInfo Region { get; }
Property Value
- RegionInfo
The RegionInfo instance, or
nullif not a country or not supported by the OS.
Remarks
Some territories (e.g., "British Indian Ocean Territory") may not have OS-level support.
Methods
GetAllDescendants()
Gets all descendant regions and countries recursively.
public IEnumerable<StatisticalRegionInfo> GetAllDescendants()
Returns
- IEnumerable<StatisticalRegionInfo>
An enumerable of all descendants in the hierarchy.
GetAncestors()
Gets all ancestor regions in the hierarchy up to and including World.
public IEnumerable<StatisticalRegionInfo> GetAncestors()
Returns
- IEnumerable<StatisticalRegionInfo>
An enumerable of ancestor regions, ordered from immediate parent to World.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.