コード例 #1
0
        private object GetServiceForGeneric(Type discriminator)
        {
            Type genericTypeDefinition = discriminator.GetGenericTypeDefinition();

            if (TypesDictionary.TryGetValue(genericTypeDefinition.ToString(), out Type type))
            {
                return(CreateInstance(type.MakeGenericType(discriminator.GetGenericArguments()[0])));
            }

            return(null);
        }
コード例 #2
0
 public bool Remove(KeyValuePair <string, Type> item)
 {
     return(TypesDictionary.Remove(item));
 }
コード例 #3
0
 public void CopyTo(KeyValuePair <string, Type>[] array, int arrayIndex)
 {
     TypesDictionary.CopyTo(array, arrayIndex);
 }