World Class
Definition
- Namespace
- Cuemon.Globalization
- Assemblies
- Cuemon.Core.dll
This static class is designed to make System.Globalization operations easier to work with.
public static class World
- Inheritance
-
objectWorld
Examples
The following example demonstrates how to query global regions, statistical regions, and cultures using the World class. It prints region counts, looks up the United States by M.49 code, and enumerates cultures for a specific region.
using System;
using System.Globalization;
using System.Linq;
using Cuemon.Globalization;
namespace Cuemon.Globalization;
public class WorldExample
{
public void Demonstrate()
{
var regions = World.Regions.ToList();
Console.WriteLine($"Number of regions: {regions.Count}");
var statisticalRegions = World.StatisticalRegions.ToList();
Console.WriteLine($"Statistical regions: {statisticalRegions.Count}");
var country = World.GetStatisticalRegion("840");
Console.WriteLine($"United States M.49: {country?.Name}");
var cultures = World.GetCultures(new RegionInfo("US"));
foreach (var culture in cultures)
{
Console.WriteLine($"Culture: {culture.DisplayName}");
}
}
}
Properties
| Name | Description |
|---|---|
| Regions | Gets the by .NET specific regions of the world. |
| StatisticalRegions | Gets all UN M.49 geographic regions. |
Methods
| Name | Description |
|---|---|
| GetCountry(RegionInfo) | Gets the UN M.49 country information for the specified RegionInfo. |
| GetCountry(string) | Gets a country by its UN M.49 code. |
| GetCultures(RegionInfo) | Resolves a sequence of related CultureInfo objects for the specified |
| GetStatisticalRegion(string) | Gets a region or country by its UN M.49 code. |