IGUtils.

GetOrAdd<TKey, TValue>(IDictionary<TKey, TValue>, TKey) Method

Summary

If the specified `key` is present in the `dictionary`, its value is returned. Otherwise a new value is added to the `dictionary` and returned.
Assembly
Kybernetik.InspectorGadgets.dll
Namespace
InspectorGadgets
Containing Type
IGUtils

Syntax

public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key) 
    where TValue : new()

Type Parameters

Name Description
TKey
TValue

Parameters

Name Type Description
dictionary IDictionary<TKey, TValue>
key TKey

Return Value

Type Description
TValue