Ejemplo n.º 1
0
 private static IEnumerable <ConstructorInfo> GetConstructors(ITypeInfo typeInfo, ITypeInfo[][] validConstructorInputs)
 {
     foreach (var inputTypes in validConstructorInputs)
     {
         var constructor = typeInfo.GetConstructor(inputTypes);
         if (constructor != null)
         {
             yield return(constructor);
         }
     }
 }
Ejemplo n.º 2
0
        public static TClient CreateServiceFromAssembly <TClient>(string assemblyName, string serviceClientClassName, AmazonServiceClient originalServiceClient) where TClient : class
        {
            ITypeInfo    typeInfo     = LoadServiceClientType(assemblyName, serviceClientClassName);
            ClientConfig clientConfig = CreateServiceConfig(assemblyName, serviceClientClassName.Replace("Client", "Config"));

            originalServiceClient.CloneConfig(clientConfig);
            return(typeInfo.GetConstructor(new ITypeInfo[2]
            {
                TypeFactory.GetTypeInfo(typeof(AWSCredentials)),
                TypeFactory.GetTypeInfo(clientConfig.GetType())
            }).Invoke(new object[2]
            {
                originalServiceClient.Credentials,
                clientConfig
            }) as TClient);
        }
 public ConstructorInfo GetConstructor(Type[] argTypes)
 {
     return(_baseInfo.GetConstructor(argTypes));
 }
Ejemplo n.º 4
0
 private static IEnumerable<ConstructorInfo> GetConstructors(ITypeInfo typeInfo, ITypeInfo[][] validConstructorInputs)
 {
     foreach(var inputTypes in validConstructorInputs)
     {
         var constructor = typeInfo.GetConstructor(inputTypes);
         if (constructor != null)
             yield return constructor;
     }
 }