internal static Type ToAspectArgumentImpl(this IPropertyAspectDefinition aspectDefinition) { var property = aspectDefinition.Member; var method = aspectDefinition.IsGetPropertyAspectDefinition() ? property.GetGetMethod() : property.GetSetMethod(); return(aspectDefinition.ToAspectArgumentImpl(method)); }
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) }); }
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()); }