Ejemplo n.º 1
0
        public static bool TryGetValue <T>(this DependencyParameterCollection collection, string key, out T value)
        {
            Guard.ArgumentNotNull(key, "key");

            if (collection != null && collection.ContainsKey(key))
            {
                value = (T)collection[key];
                return(true);
            }
            else
            {
                value = default(T);
                return(false);
            }
        }
Ejemplo n.º 2
0
        public static T GetValueOrDefault <T>(this DependencyParameterCollection collection, string key, T defaultValue)
        {
            Guard.ArgumentNotNull(key, "key");

            return((collection != null && collection.ContainsKey(key)) ? (T)collection[key] : defaultValue);
        }