3 using System.Collections.Generic;
5 namespace SiliconStudio.Core.Extensions
9 public static bool TryGetValueCast<TKey, TValue, TResult>(
this IDictionary<TKey, TValue> dictionary, TKey key, out TResult result)
10 where TResult : TValue
13 if (dictionary.TryGetValue(key, out value))
15 result = (TResult)value;
19 result =
default(TResult);
26 dictionary.TryGetValue(key, out value);