Class CountryExtensions
- Namespace
- XENBIT.ResQueServe.Core.Extensions
- Assembly
- RQS.Core.dll
Provides extension methods for the Country enumeration to retrieve metadata attributes such as calling format, ISO codes, and coordinates.
public static class CountryExtensions
- Inheritance
-
CountryExtensions
- Inherited Members
Methods
GetCallingFormat(Country)
Retrieves the calling format for the specified Country.
public static string GetCallingFormat(this Country country)
Parameters
countryCountryThe country enumeration value.
Returns
- string
A string representing the calling format, or an empty string if not specified.
GetCoordinates(Country)
Retrieves the center coordinates for the specified Country.
public static Coordinates GetCoordinates(this Country country)
Parameters
countryCountryThe country enumeration value.
Returns
- Coordinates
A Coordinates object representing the center coordinates, or default coordinates (0.0, 0.0) if not specified.
GetCountriesWithSimulationSupport()
Gets all countries that have SimulationSupport attribute.
public static Country[] GetCountriesWithSimulationSupport()
Returns
- Country[]
An array of Country values that support simulation.
GetCultureInfo(Country)
public static CultureInfo GetCultureInfo(this Country country)
Parameters
countryCountry
Returns
GetIsoAlpha2(Country)
Retrieves the ISO Alpha-2 code for the specified Country.
public static string GetIsoAlpha2(this Country country)
Parameters
countryCountryThe country enumeration value.
Returns
- string
A string representing the ISO Alpha-2 code, or an empty string if not specified.
GetIsoAlpha3(Country)
Retrieves the ISO Alpha-3 code for the specified Country.
public static string GetIsoAlpha3(this Country country)
Parameters
countryCountryThe country enumeration value.
Returns
- string
A string representing the ISO Alpha-3 code, or an empty string if not specified.
GetLocale(Country)
Retrieves the locale identifier for the specified Country.
public static string GetLocale(this Country country)
Parameters
countryCountryThe country enumeration value.
Returns
- string
A string representing the locale identifier, or an empty string if not specified.
GetLocaleTwoLetter(Country)
Retrieves the two-letter locale identifier for the specified Country, if available.
public static string GetLocaleTwoLetter(this Country country)
Parameters
countryCountryThe country enumeration value.
Returns
- string
A string representing the two-letter locale identifier, or an empty string if not specified.
GetPhoneCode(Country)
Retrieves the phone code for the specified Country.
public static string GetPhoneCode(this Country country)
Parameters
countryCountryThe country enumeration value.
Returns
- string
A string representing the phone code, or an empty string if not specified.
GetSimulationSupportedCountries(Type)
Gets all countries with SimulationSupport as an extension method on the Country enum type.
public static Country[] GetSimulationSupportedCountries(this Type countryType)
Parameters
countryTypeTypeThe Country enum type (not used, but required for extension syntax).
Returns
- Country[]
An array of Country values that support simulation.
GetTimeZoneId(Country)
Retrieves the time zone identifier for the specified Country.
public static string GetTimeZoneId(this Country country)
Parameters
countryCountryThe country enumeration value.
Returns
- string
A string representing the time zone identifier, or an empty string if not specified.
GetTimeZoneInfo(Country)
Gets the TimeZoneInfo associated with the specified Country value.
public static TimeZoneInfo GetTimeZoneInfo(this Country country)
Parameters
Returns
- TimeZoneInfo
The TimeZoneInfo instance corresponding to the time zone defined in the TimeZoneAttribute on the specified Country enum value.
GetTimeZoneOffset(Country)
Retrieves the time zone offset in hours from UTC for the specified Country.
public static TimeSpan GetTimeZoneOffset(this Country country)
Parameters
countryCountryThe country enumeration value.
Returns
- TimeSpan
An integer representing the time zone offset in hours, or zero if not specified.
HasSimulationSupport(Country)
Checks if a specific country has SimulationSupport attribute.
public static bool HasSimulationSupport(this Country country)
Parameters
countryCountryThe country to check.
Returns
- bool
True if the country has SimulationSupport, false otherwise.