Click or drag to resize

ConversionsGetValueT Method (IDictionaryString, String, String, T, IFormatProvider)

Gets a value from a dictionary by its key/name.

Namespace:  callback.ShellBoost.Core.Utilities
Assembly:  callback.CBFSShell (in callback.CBFSShell.dll) Version: 22.0.0.0
Syntax
C#
public static T GetValue<T>(
	this IDictionary<string, string> dictionary,
	string key,
	T defaultValue = null,
	IFormatProvider provider = null
)

Parameters

dictionary
Type: System.Collections.GenericIDictionaryString, String
The input dictionary.
key
Type: SystemString
The key.
defaultValue (Optional)
Type: T
The default value to use if the value corresponding to the key was not found in the dictionary.
provider (Optional)
Type: SystemIFormatProvider
The format provider.

Type Parameters

T
The expected value type

Return Value

Type: T
The value corresponding to the key or the default value.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IDictionaryString, String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionkey is null.
See Also