C# Class Qowaiv.Globalization.PostalCodeCountryInfo

显示文件 Open project: Corniel/Qowaiv Class Usage Examples

Private Properties

Property Type Description
New PostalCodeCountryInfo
PostalCodeCountryInfo System.Collections.Generic

Public Methods

Method Description
Format ( string postalcode ) : string

Formats the postal code.

If the country supports formatting and if the postal code is valid for the country.

GetCountriesWithFormatting ( ) : IEnumerable

Gets countries with postal codes with formatting.

GetCountriesWithSingleValue ( ) : IEnumerable

Gets countries with a single postal code value.

GetCountriesWithoutPostalCode ( ) : IEnumerable

Gets countries without a postal code system.

GetInstance ( Country country ) : PostalCodeCountryInfo

Gets the postal code country info associated with the specified country.

GetSingleValue ( ) : string

Gets the single value if supported, otherwise string.Empty.

IsValid ( string postalcode ) : bool

Returns true if the postal code is valid for the specified country, otherwise false.

Returns false if the country does not have postal codes.

Private Methods

Method Description
New ( Country country, string validation, string search = null, string replace = null, bool isSingle = false ) : PostalCodeCountryInfo

Creates a new instance.

Used for ininitalating the Instances dictionary.

PostalCodeCountryInfo ( ) : System.Collections.Generic

Constructor.

Method Details

Format() public method

Formats the postal code.
If the country supports formatting and if the postal code is valid for the country.
public Format ( string postalcode ) : string
postalcode string /// The postal code. ///
return string

GetCountriesWithFormatting() public static method

Gets countries with postal codes with formatting.
public static GetCountriesWithFormatting ( ) : IEnumerable
return IEnumerable

GetCountriesWithSingleValue() public static method

Gets countries with a single postal code value.
public static GetCountriesWithSingleValue ( ) : IEnumerable
return IEnumerable

GetCountriesWithoutPostalCode() public static method

Gets countries without a postal code system.
public static GetCountriesWithoutPostalCode ( ) : IEnumerable
return IEnumerable

GetInstance() public static method

Gets the postal code country info associated with the specified country.
public static GetInstance ( Country country ) : PostalCodeCountryInfo
country Country /// The specified country. ///
return PostalCodeCountryInfo

GetSingleValue() public method

Gets the single value if supported, otherwise string.Empty.
public GetSingleValue ( ) : string
return string

IsValid() public method

Returns true if the postal code is valid for the specified country, otherwise false.
Returns false if the country does not have postal codes.
public IsValid ( string postalcode ) : bool
postalcode string /// The postal code to test. ///
return bool