public virtual void Register(Type component) { if (component == null) { throw new ArgumentNullException(); } Register(ComponentContextUtils.GetComponentDefaultName(component), ComponentContextUtils.CreateLocalFactory(component)); }
public virtual void Register(string name, Type componentType) { if (componentType == null) { throw new ArgumentNullException(nameof(componentType)); } Register(name, ComponentContextUtils.CreateLocalFactory(componentType)); }
public virtual void Register(Type contract, string name, Type component) { if (contract == null) { throw new ArgumentNullException(nameof(contract)); } if (component == null) { throw new ArgumentNullException(nameof(component)); } ComponentContextUtils.ThrowIfNotSubTypeOf(contract, component); InternalRegister(contract, name, ComponentContextUtils.CreateLocalFactory(component), true); }
private void RegisterBuildInComponents() { InternalRegister(typeof(DefaultComponentCache), null, ComponentContextUtils.CreateLocalFactory(typeof(DefaultComponentCache)), false); InternalRegister(typeof(ContractAgnosticComponentCache), null, ComponentContextUtils.CreateLocalFactory(typeof(ContractAgnosticComponentCache)), false); InternalRegister(typeof(StaticComponentCache), null, ComponentContextUtils.CreateLocalFactory(typeof(StaticComponentCache)), false); InternalRegister(typeof(ThreadLocalComponentCache), null, ComponentContextUtils.CreateLocalFactory(typeof(ThreadLocalComponentCache)), false); InternalRegister(typeof(IClassEmitter), null, ComponentContextUtils.CreateLocalFactory(typeof(DefaultClassEmitter)), false); InternalRegister(typeof(IMethodEmitter), null, ComponentContextUtils.CreateLocalFactory(typeof(DefaultMethodEmitter)), false); InternalRegister(typeof(IPropertyEmitter), null, ComponentContextUtils.CreateLocalFactory(typeof(DefaultPropertyEmitter)), false); InternalRegister(typeof(IEventEmitter), null, ComponentContextUtils.CreateLocalFactory(typeof(DefaultEventEmitter)), false); }