Click or drag to resize
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.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static Converter<TKey, TValue> GetDictionaryConverter<TKey, TValue>(
	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, TValue
A delegate to a method that converts keys to values.
Exceptions
ExceptionCondition
ArgumentNullExceptiondictionary is null.
Remarks
This delegate can be used as a parameter in Convert or ConvertAll methods to convert entire collections.
See Also