Class DictionaryUtilities
Contains many utility functions for working with dictionaries
Namespace: WeaverCore.Utilities
Assembly: WeaverCore.dll
Syntax
public static class DictionaryUtilities
Methods
| Edit this page View SourceTryGetValueOfType<TCast>(IDictionary, object, out TCast)
Tries to get a value of a certain type
Declaration
public static bool TryGetValueOfType<TCast>(this IDictionary dictionary, object key, out TCast value)
Parameters
Type | Name | Description |
---|---|---|
IDictionary | dictionary | The dictionary to try on |
object | key | The key of the value |
TCast | value | The output value if successful |
Returns
Type | Description |
---|---|
bool | Returns true if a value of the specified type exists at the key |
Type Parameters
Name | Description |
---|---|
TCast | The type of value to get |
TryGetValueOfType<TCast>(IDictionary, object, out TCast, TCast)
Tries to get a value of a certain type
Declaration
public static bool TryGetValueOfType<TCast>(this IDictionary dictionary, object key, out TCast value, TCast defaultVal)
Parameters
Type | Name | Description |
---|---|---|
IDictionary | dictionary | The dictionary to try on |
object | key | The key of the value |
TCast | value | The output value if successful |
TCast | defaultVal | The default value to use if unsuccessful |
Returns
Type | Description |
---|---|
bool | Returns true if a value of the specified type exists at the key. Uses the |
Type Parameters
Name | Description |
---|---|
TCast | The type of value to get |