Exemple #1
0
        protected override AbstractProducer TranslateTypes(GenericUtils.Resolution resolution)
        {
            var resolvedMethod = GenericUtils.TranslateMethodGenericArguments(_method, resolution.GenericParameterTranslations);

            if (resolvedMethod == null || GenericUtils.MemberContainsGenericArguments(resolvedMethod))
            {
                return(null);
            }

            return(new ProducerMethod(DeclaringComponent.Resolve(resolvedMethod.DeclaringType), resolvedMethod, Binders, Scope, Manager));
        }
Exemple #2
0
 protected void TransferInjectionPointsTo(AbstractComponent component, GenericUtils.Resolution resolution)
 {
     component.AddInjectionPoints(_injectionPoints.Select(x =>
     {
         if (x.DeclaringComponent.Type == component.Type)
         {
             return(x);
         }
         return(x.TranslateGenericArguments(component, resolution.GenericParameterTranslations));
     }).ToArray());
 }
Exemple #3
0
        private ClassComponent(ClassComponent parent, Type type, IEnumerable <IBinderAttribute> binders, Type scope, WeldComponentManager manager, GenericUtils.Resolution typeResolution)
            : base(new ComponentIdentifier(parent.Id.Key, type), type, binders, scope, manager,
                   parent.PostConstructs.Select(x => GenericUtils.TranslateMethodGenericArguments(x, typeResolution.GenericParameterTranslations)).ToArray())
        {
            parent.TransferInjectionPointsTo(this, typeResolution);
            _lazyMixins = new Lazy <Mixin[]>(() => Manager.GetMixins(this));

            _lazyInterceptors = new Lazy <Interceptor[]>(() => new Interceptor[0]);
            //_lazyInterceptors = new Lazy<Interceptor[]>(() => Manager.GetInterceptors(this));
            //_interceptedMethods = InitInterceptedMethods();
        }
Exemple #4
0
        protected override AbstractProducer TranslateTypes(GenericUtils.Resolution resolution)
        {
            var resolvedProperty = GenericUtils.TranslatePropertyType(_property, resolution.GenericParameterTranslations);

            return(new ProducerProperty(DeclaringComponent.Resolve(resolvedProperty.DeclaringType), resolvedProperty, Binders, Scope, Manager));
        }
Exemple #5
0
 protected abstract AbstractProducer TranslateTypes(GenericUtils.Resolution resolution);
Exemple #6
0
        protected override AbstractProducer TranslateTypes(GenericUtils.Resolution resolution)
        {
            var resolvedField = GenericUtils.TranslateFieldType(_field, resolution.GenericParameterTranslations);

            return(new ProducerField(DeclaringComponent.Resolve(resolvedField.DeclaringType), resolvedField, Binders, Scope, Manager));
        }