Esempio n. 1
0
        internal static Type ToAspectArgumentImpl(this IPropertyAspectDefinition aspectDefinition)
        {
            var property = aspectDefinition.Member;
            var method   = aspectDefinition.IsGetPropertyAspectDefinition() ?
                           property.GetGetMethod() :
                           property.GetSetMethod();

            return(aspectDefinition.ToAspectArgumentImpl(method));
        }
Esempio n. 2
0
        private static BindingSettings ToPropertyBindingSettings(this IPropertyAspectDefinition aspectDefinition)
        {
            var aspectArgumentType     = aspectDefinition.GetArgumentType();
            var aspectArgumentImplType = aspectDefinition.ToAspectArgumentImpl();
            var genericArguments       = aspectArgumentImplType.GetGenericArguments();

            return(new BindingSettings {
                MemberType = MemberTypes.Property,
                MemberInfo = aspectDefinition.Member,
                ArgumentType = aspectArgumentImplType,
                BindingType = aspectArgumentType.MakeGenericPropertyBinding(genericArguments)
            });
        }
Esempio n. 3
0
        internal static Type ToAspectArgumentImpl(this IAspectDefinition aspectDefinition)
        {
            IPropertyAspectDefinition propertyAspectDefinition = null;
            var methodAspectDefinition = aspectDefinition as IMethodAspectDefinition;

            if (methodAspectDefinition.IsNotNull())
            {
                return(methodAspectDefinition.ToAspectArgumentImpl());
            }

            propertyAspectDefinition = aspectDefinition as IPropertyAspectDefinition;

            if (propertyAspectDefinition.IsNotNull())
            {
                return(propertyAspectDefinition.ToAspectArgumentImpl());
            }

            return(((IEventAspectDefinition)aspectDefinition).ToAspectArgumentImpl());
        }