AlgorithmsGetDictionaryConverterTKey, TValue Method (IDictionaryTKey, TValue, TValue) |
Creates a delegate that converts keys to values by used a dictionary to map values. Keys
that a not present in the dictionary are converted to a supplied default value.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static Converter<TKey, TValue> GetDictionaryConverter<TKey, TValue>(
IDictionary<TKey, TValue> dictionary,
TValue defaultValue
)
public:
generic<typename TKey, typename TValue>
static Converter<TKey, TValue>^ GetDictionaryConverter(
IDictionary<TKey, TValue>^ dictionary,
TValue defaultValue
)
Parameters
- dictionary
- Type: System.Collections.GenericIDictionaryTKey, TValue
The dictionary used to perform the conversion. - defaultValue
- Type: TValue
The result of the conversion for keys that are not present in the dictionary.
Type Parameters
- TKey
[Missing <typeparam name="TKey"/> documentation for "M:X3Platform.Collections.Algorithms.GetDictionaryConverter``2(System.Collections.Generic.IDictionary{``0,``1},``1)"]
- TValue
[Missing <typeparam name="TValue"/> documentation for "M:X3Platform.Collections.Algorithms.GetDictionaryConverter``2(System.Collections.Generic.IDictionary{``0,``1},``1)"]
Return Value
Type:
ConverterTKey,
TValueA delegate to a method that converts keys to values.
Exceptions
RemarksThis delegate can be used as a parameter in Convert or ConvertAll methods to convert
entire collections.
See Also