ConversionsGetValueT Method (IDictionaryString, String, String, T, IFormatProvider) |
Gets a value from a dictionary by its key/name.
Namespace:
ShellBoost.Core.Utilities
Assembly:
ShellBoost.Core (in ShellBoost.Core.dll) Version: 1.8.3.0
Syntax 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:
TThe 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 See Also