/// <summary> /// Resolves the component(s) from given kernel. /// </summary> /// <param name = "kernel"></param> /// <param name = "scope"></param> /// <returns>Resolved component(s).</returns> public virtual object Resolve(IKernelInternal kernel, IReleasePolicy scope) { if (kernel.HasComponent(ComponentName) == false) { return kernel.Resolve(ComponentType, AdditionalArguments, scope); } return kernel.Resolve(ComponentName, ComponentType, AdditionalArguments, scope); }
void IRegistration.Register(IKernelInternal kernel) { foreach (IWcfClientModel channel in channels) { var registration = Component.For(channel.Contract); registration.DependsOn(Property.ForKey("channel").Eq(channel)); if (configurer != null) { configurer(registration); } if (String.IsNullOrEmpty(registration.Name)) { registration.Named(Guid.NewGuid().ToString()); } if (!kernel.HasComponent(registration.Name)) { kernel.Register(registration); } } }
private bool CanProvideDependenciesDynamically(CreationContext context) { return(context.HasAdditionalArguments || kernel.HasComponent(typeof(ILazyComponentLoader))); }
private bool SkipRegistration(IKernelInternal internalKernel, ComponentModel componentModel) { return(ifComponentRegisteredIgnore && internalKernel.HasComponent(componentModel.Name)); }