Exemplo n.º 1
0
        public IEnumerable <KeyValuePair <TKey, TValue> > GetKeyValuePairs()
        {
            string[] stringKeys = keys.GetKeys().ToArray();

            KeyValuePair <TKey, TValue>[] pairs = new KeyValuePair <TKey, TValue> [stringKeys.Length];

            int i = 0;

            foreach (string stringKey in stringKeys)
            {
                pairs[i] = new KeyValuePair <TKey, TValue>((dynamic)keys.GetValue(stringKey), (dynamic)values.GetValue(stringKey));
                i++;
            }

            return(pairs);
        }
Exemplo n.º 2
0
        private PropertyMetadata ResolveTypeMetadata(Type type)
        {
            Type closestBaseType = GetOrderedTypeMetadata().Where(baseType => type == baseType || type.IsSubclassOf(baseType)).LastOrDefault();

            return(closestBaseType != null?typeMetadata.GetValue(closestBaseType) : ownerMetadata);
        }