Class CurrencyRegistry
Represents a collection of currencies.
Implements
Namespace: Singulink.Globalization
Assembly: Singulink.Globalization.Currency.dll
Syntax
public sealed class CurrencyRegistry : IReadOnlySet<Currency>, IReadOnlyCollection<Currency>, ISet<Currency>, ICollection<Currency>, IEnumerable<Currency>, IEnumerable
Constructors
| Name | Description |
|---|---|
| CurrencyRegistry(string, IEnumerable<Currency>) | Initializes a new instance of the CurrencyRegistry class with the specified name and set of currencies. |
Properties
| Name | Description |
|---|---|
| Count | Gets the number of currencies in this registry. |
| Default | Gets the default currency registry. Unless a different registry has been set with SetDefault(Func<CurrencyRegistry>), this is a registry built from system globalization data. |
| this[ReadOnlySpan<char>] | Gets a currency from this registry with the specified currency code. |
| this[string] | Gets a currency from this registry with the specified currency code. |
| Name | Gets the name of this currency registry. |
Methods
| Name | Description |
|---|---|
| Contains(Currency) | Gets a value indicating whether this registry contains the specified currency. |
| Contains(ReadOnlySpan<char>) | Gets a value indicating whether this registry contains a currency with the specified currency code. |
| Contains(string) | Gets a value indicating whether this registry contains a currency with the specified currency code. |
| GetEnumerator() | Returns an enumerator that iterates through the currencies in this registry, ordered by currency code. |
| IsProperSubsetOf(IEnumerable<Currency>) | Determines whether this registry is a proper (strict) subset of the specified currency collection. |
| IsProperSupersetOf(IEnumerable<Currency>) | Determines whether this registry is a proper superset of the specified currency collection. |
| IsSubsetOf(IEnumerable<Currency>) | Determines whether this registry is a subset of the specified currency collection. |
| IsSupersetOf(IEnumerable<Currency>) | Determines whether this registry is a superset of the specified currency collection. |
| Overlaps(IEnumerable<Currency>) | Determines whether this registry and the specified currency collection share common elements. |
| ParseMonetaryValue(ReadOnlySpan<char>, MonetaryStyles, IFormatProvider?) | Converts the string representation of a monetary value to its MonetaryValue equivalent using this currency registry. |
| ParseMonetaryValue(string, MonetaryStyles, IFormatProvider?) | Converts the string representation of a monetary value to its MonetaryValue equivalent using this currency registry. |
| SetDefault(CurrencyRegistry) | Sets the registry that Default returns. This method must be called at application startup before the default registry is first accessed, i.e. before any currencies or monetary values are created that do not explicitly specify a registry. |
| SetDefault(Func<CurrencyRegistry>) | Sets the registry that Default returns. This method must be called at application startup before the default registry is first accessed, i.e. before any currencies or monetary values are created that do not explicitly specify a registry. |
| SetDefaultProvider(ICurrencyDataProvider, CurrencyTypes) | Sets the registry that Default returns to a registry created from the specified currency data provider, i.e. the CLDR data provided by
the |
| SetEquals(IEnumerable<Currency>) | Determines whether this registry and the specified currency collection contain the same elements. |
| TryGetCurrenciesBySymbol(ReadOnlySpan<char>, out IReadOnlyList<Currency>) | Gets the currencies in this registry that use the specified currency symbol, ordered by currency code. |
| TryGetCurrenciesBySymbol(ReadOnlySpan<char>, CultureInfo?, out IReadOnlyList<Currency>) | Gets the currencies in this registry that use the specified currency symbol, ordered by currency code. |
| TryGetCurrenciesBySymbol(string, out IReadOnlyList<Currency>) | Gets the currencies in this registry that use the specified currency symbol, ordered by currency code. |
| TryGetCurrenciesBySymbol(string, CultureInfo?, out IReadOnlyList<Currency>) | Gets the currencies in this registry that use the specified currency symbol, ordered by currency code. |
| TryGetCurrency(ReadOnlySpan<char>, out Currency) | Gets a currency from this registry with the specified currency code. |
| TryGetCurrency(string, out Currency) | Gets a currency from this registry with the specified currency code. |
| TryGetLocalCurrency(out Currency) | Gets the local currency for the current culture. Culture must be region-specific for this method to succeed. |
| TryGetLocalCurrency(CultureInfo, out Currency) | Gets the local currency for the specified culture. Culture must be region-specific for this method to succeed. |
| TryGetLocalCurrency(RegionInfo, out Currency) | Gets the local currency for the specified region. |
| TryParseMonetaryValue(ReadOnlySpan<char>, MonetaryStyles, IFormatProvider?, out MonetaryValue) | Converts the string representation of a monetary value to its MonetaryValue equivalent using this currency registry. |
| TryParseMonetaryValue(ReadOnlySpan<char>, MonetaryStyles, IFormatProvider?, out MonetaryValue, out string) | Converts the string representation of a monetary value to its MonetaryValue equivalent using this currency registry. |
| TryParseMonetaryValue(string?, MonetaryStyles, IFormatProvider?, out MonetaryValue) | Converts the string representation of a monetary value to its MonetaryValue equivalent using this currency registry. |
| TryParseMonetaryValue(string?, MonetaryStyles, IFormatProvider?, out MonetaryValue, out string) | Converts the string representation of a monetary value to its MonetaryValue equivalent using this currency registry. |
Explicit Interface Implementations
| Name | Description |
|---|---|
| ICollection<Currency>.Add(Currency?) | Not supported. |
| ICollection<Currency>.Clear() | Not supported. |
| ICollection<Currency>.CopyTo(Currency[], int) | Copies the currencies in this registry to an array. |
| ICollection<Currency>.IsReadOnly | Gets a value indicating whether the bag is read-only. Always returns true. |
| ICollection<Currency>.Remove(Currency?) | Not supported. |
| IEnumerable<Currency>.GetEnumerator() | Returns an enumerator that iterates through the currencies in this registry, ordered by currency code. |
| ISet<Currency>.Add(Currency?) | Not supported. |
| ISet<Currency>.ExceptWith(IEnumerable<Currency>?) | Not supported. |
| ISet<Currency>.IntersectWith(IEnumerable<Currency>?) | Not supported. |
| ISet<Currency>.SymmetricExceptWith(IEnumerable<Currency>?) | Not supported. |
| ISet<Currency>.UnionWith(IEnumerable<Currency>?) | Not supported. |
| IEnumerable.GetEnumerator() | Returns an enumerator that iterates through the currencies in this registry, ordered by currency code. |