Esempio n. 1
0
        private static void InvokeSetupImplicitPropResolvers <CType>(MemberInfo memberInfo, Type memberType, string memberName, Resolver <CType> resolver)
            where CType : class
        {
            if (!memberType.IsClass && !memberType.IsInterface)
            {
                throw InjectorErrors.ErrorUnableToBindNonClassFieldsProperties.FormatEx(memberName, typeof(CType).FullName);
            }

            resolver.AddMethodInfoSetter(memberInfo, null);
        }
Esempio n. 2
0
            private IInjectorBinding <CType> AddPropertyInjectorInner <TPropertyType>(Expression <Func <CType, TPropertyType> > propertyExpression, Expression <Func <TPropertyType> > setter)
            {
                var propertyMemberExpression = propertyExpression.Body as MemberExpression;

                if (propertyMemberExpression == null)
                {
                    throw InjectorErrors.ErrorMustContainMemberExpression.FormatEx("propertyExpression");
                }

                var member = propertyMemberExpression.Member;

                resolver.AddMethodInfoSetter(member, setter);

                return(this);
            }