Exemple #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);
        }
Exemple #2
0
 private bool ResolveTypeContains(Type type)
 {
     return(typeMetadata.GetKeys().Any(baseType => type == baseType || type.IsSubclassOf(baseType)));
 }