Confuser.Core/Utils.cs
/// <summary>
///     Gets the value associated with the specified key, or default value if the key does not exists.
/// </summary>
/// <typeparam name="TKey">The type of the key.</typeparam>
/// <typeparam name="TValue">The type of the value.</typeparam>
/// <param name="dictionary">The dictionary.</param>
/// <param name="key">The key of the value to get.</param>
/// <param name="defValue">The default value.</param>
/// <returns>The value associated with the specified key, or the default value if the key does not exists</returns>
Gets the value associated with the specified key, or default value if the key does not exists.
Gets the value associated with the specified key or default value if the key does not exists .
public static TValue GetValueOrDefault<TKey, TValue>(
            this Dictionary<TKey, TValue> dictionary,
            TKey key,
            TValue defValue = default(TValue))
        {
            TValue ret;
            if (dictionary.TryGetValue(key, out ret))
                return ret;
            return defValue;
        }
public static TValue GetValueOrDefault < TKey , TValue > ( this Dictionary < TKey , TValue > dictionary , TKey key , TValue defValue = default ( TValue ) ) { TValue ret ; if ( dictionary . TryGetValue ( key , out ret ) ) return ret ; return defValue ; }
Gets the value associated with the specified key, or default value if the key does not exists.
Gets the value associated with the specified key or default value if the key does not exists .
The value associated with the specified key, or the default value if the key does not exists
The value associated with the specified key or the default value if the key does not exists
Dictionary<TKey, TValue>
this
key
TKey
The key of the value to get.
The key of the value to get .
defValue
TValue
The default value.
The default value .
dictionary
None
typeparam
The type of the key.
The type of the key .
typeparam
The type of the value.
The type of the value .