Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
CountryCodeToName.cs
1using System.Globalization;
3
5{
9 public class CountryCodeToName : IValueConverter, IMarkupExtension
10 {
12 public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
13 {
14 if (value is string Code)
15 return ISO_3166_1.ToName(Code) ?? Code;
16 else
17 return value ?? string.Empty;
18 }
19
21 public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
22 {
23 return value;
24 }
25
27 public object ProvideValue(System.IServiceProvider serviceProvider)
28 {
29 return this;
30 }
31 }
32}
Conversion between Country Names and ISO-3166-1 country codes.
Definition: ISO_3166_1.cs:10
static ? string ToName(string? CountryCode)
Converts the code to a country name (if found). If not found, returns the original code.
Definition: ISO_3166_1.cs:98
Converts a country code to a country name.
object ProvideValue(System.IServiceProvider serviceProvider)
object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)