Show / Hide Table of Contents

Class DictionaryUtilities

Contains many utility functions for working with dictionaries

Inheritance
object
DictionaryUtilities
Namespace: WeaverCore.Utilities
Assembly: WeaverCore.dll
Syntax
public static class DictionaryUtilities

Methods

| Edit this page View Source

TryGetValueOfType<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

| Edit this page View Source

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 defaultVal if unsuccessful

Type Parameters
Name Description
TCast

The type of value to get

  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾