public static MethodBase FindActivationConstructor(Type declaringType) { MethodBase ctor = declaringType.GetActivationConstructor(); if (ctor == null) ctor = declaringType.GetConstructors().FirstOrDefault(); return ctor; }
protected virtual MethodBase GetActivationConstructor(Type type) { return type.GetActivationConstructor(); }
public ProviderTypeFactoryDefinition(Type providerType, Type concreteProviderType) : base(concreteProviderType.GetActivationConstructor(), AppDomain.CurrentDomain.GetProviderName(providerType, concreteProviderType), concreteProviderType) { this.providerType = providerType; this.concreteProviderType = concreteProviderType; }