private object GetReference(IInjectionPoint injectionPoint, IComponent component, ICreationalContext creationalContext, params Type[] proxyTypes) { var pushInjectionPoint = injectionPoint != null && injectionPoint.ComponentType != typeof(IInjectionPoint); try { if (pushInjectionPoint) { _currentInjectionPoint.Push(injectionPoint); } if (proxyTypes.Any() && component.IsProxyRequired) { foreach (var proxyType in proxyTypes) { InjectionValidator.ValidateProxiable(proxyType, injectionPoint); } return(CormoProxyGenerator.CreateProxy(proxyTypes, () => { try { if (pushInjectionPoint) { _currentInjectionPoint.Push(injectionPoint); } return GetReference(injectionPoint, component, creationalContext, new Type[0]); } finally { if (pushInjectionPoint) { _currentInjectionPoint.Pop(); } } })); } var context = creationalContext as IWeldCreationalContext; if (context != null) { var incompleteInstance = context.GetIncompleteInstance(component); if (incompleteInstance != null) { return(incompleteInstance); } } creationalContext = creationalContext.GetCreationalContext(component); return(GetContext(component.Scope).Get(component, creationalContext)); } finally { if (pushInjectionPoint) { _currentInjectionPoint.Pop(); } } }
public FieldInjectionPoint(IComponent declaringComponent, IAnnotatedField field) : this(declaringComponent, field.Field, field.Annotations) { InjectionValidator.Validate(field); }
public PropertyInjectionPoint(IComponent declaringComponent, PropertyInfo property, IBinderAttribute[] binders) : base(declaringComponent, property, property.PropertyType, binders) { InjectionValidator.Validate(property); _property = property; }
public FieldInjectionPoint(IComponent declaringComponent, FieldInfo field, IBinderAttribute[] binders) : base(declaringComponent, field, field.FieldType, binders) { InjectionValidator.Validate(field); _field = field; }
public PropertyInjectionPoint(IComponent declaringComponent, IAnnotatedProperty property) : this(declaringComponent, property.Property, property.Annotations) { InjectionValidator.Validate(property); }