public object Create(IBuilderContext context, object buildKey) { Guard.ArgumentNotNull(context, "context"); return(Activator.CreateInstance(BuilderStrategy.GetTypeFromBuildKey(buildKey), GetParameters(context, null))); }
public IBuilderPolicy Get(Type policyInterface, object buildKey, bool localOnly) { Type buildType; if (!BuilderStrategy.TryGetTypeFromBuildKey(buildKey, out buildType) || !buildType.IsGenericType) { return (GetNoDefault(policyInterface, buildKey, localOnly) ?? GetNoDefault(policyInterface, null, localOnly)); } return (GetNoDefault(policyInterface, buildKey, localOnly) ?? GetNoDefault(policyInterface, buildType.GetGenericTypeDefinition(), localOnly) ?? GetNoDefault(policyInterface, null, localOnly)); }