/// <summary> /// 通过协议注册器注册给定程序集的类型. See <see cref="AddConventionalRegistrar"/> method. /// </summary> /// <param name="assembly">注册程序集</param> /// <param name="config">其他配置信息</param> public void RegisterAssemblyByConvention(Assembly assembly, ConventionalRegistrationConfig config) { var context = new ConventionalRegistrationContext(assembly, this, config); foreach (var registerer in _conventionalRegistrars) { registerer.RegisterAssembly(context); } if (config.InstallInstallers) { IocContainer.Install(FromAssembly.Instance(assembly)); } }
internal ConventionalRegistrationContext(Assembly assembly, IIocManager iocManager, ConventionalRegistrationConfig config) { Assembly = assembly; IocManager = iocManager; Config = config; }