internal BindingRemoveEventInterceptionAspectWeaver(IEventAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings, FieldInfo weavedType)
     : base(aspectDefinition, aspectWeavingSettings, weavedType) {
     argumentsWeavingSettings.BindingsDependency = weavedType;
     argumentsWeavingSettings.Parameters = new[] { aspectDefinition.Member.EventHandlerType };
     argumentsWeaver = new BindingEventInterceptionArgumentsWeaver(aspectDefinition, argumentsWeavingSettings, aspectWeavingSettings, bindingSettings);
     weaver = new MethodScopeWeaversQueue(methodScopeWeavers);
 }
 internal BindingRemoveEventInterceptionAspectWeaver(IEventAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings, FieldInfo weavedType)
     : base(aspectDefinition, aspectWeavingSettings, weavedType)
 {
     argumentsWeavingSettings.BindingsDependency = weavedType;
     argumentsWeavingSettings.Parameters = new[] { aspectDefinition.Member.EventHandlerType };
     argumentsWeaver = new BindingEventInterceptionArgumentsWeaver(aspectDefinition, argumentsWeavingSettings, aspectWeavingSettings, bindingSettings);
     weaver = new MethodScopeWeaversQueue(methodScopeWeavers);
 }
        internal BindingRaiseEventInterceptionAspectWeaver(IEventAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings, FieldInfo weavedType)
            : base(aspectDefinition, aspectWeavingSettings, weavedType)
        {
            argumentsWeavingSettings.BindingsDependency = weavedType;
            argumentsWeavingSettings.Parameters = new[] { aspectDefinition.Member.EventHandlerType };
            argumentsWeaver = new BindingEventInterceptionArgumentsWeaver(aspectDefinition, argumentsWeavingSettings, aspectWeavingSettings, bindingSettings);

            if (aspectDefinition.Member.IsFunction()) {
                methodScopeWeavers.Add(new TopGetReturnValueWeaver(aspectWeavingSettings, argumentsWeavingSettings));
            }

            weaver = new MethodScopeWeaversQueue(methodScopeWeavers);
        }
Пример #4
0
        internal TopRaiseEventInterceptionAspectWeaver(IEventAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings, FieldInfo weavedType)
            : base(aspectDefinition, aspectWeavingSettings, weavedType)
        {
            argumentsWeavingSettings.BindingsDependency = weavedType;
            argumentsWeavingSettings.Parameters         = new[] { aspectDefinition.Member.EventHandlerType };
            argumentsWeaver = new TopRaiseEventInterceptionArgumentsWeaver(aspectDefinition, argumentsWeavingSettings, aspectWeavingSettings, bindingSettings);

            if (aspectDefinition.Member.IsFunction())
            {
                methodScopeWeavers.Add(new TopGetReturnValueWeaver(aspectWeavingSettings, argumentsWeavingSettings));
            }

            weaver = new MethodScopeWeaversQueue(methodScopeWeavers);
        }
Пример #5
0
        private static BindingSettings ToEventBindingSettings(this IEventAspectDefinition aspectDefinition)
        {
            var aspectArgumentType     = aspectDefinition.GetArgumentType();
            var aspectArgumentImplType = aspectDefinition.ToAspectArgumentImpl();
            var genericArguments       = aspectArgumentImplType.GetGenericArguments();

            if (aspectArgumentType.IsFunctionAspectArgs())
            {
                return(new BindingSettings {
                    HasReturnType = true,
                    MemberType = MemberTypes.Event,
                    MemberInfo = aspectDefinition.Member,
                    ArgumentType = aspectArgumentImplType,
                    BindingType = aspectArgumentType.MakeEventGenericFunctionBinding(genericArguments)
                });
            }

            return(new BindingSettings {
                MemberType = MemberTypes.Event,
                MemberInfo = aspectDefinition.Member,
                ArgumentType = aspectArgumentImplType,
                BindingType = aspectArgumentType.MakeEventGenericActionBinding(genericArguments)
            });
        }
 internal AbstractAddEventInterceptionAspectWeaver(IEventAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings, FieldInfo weavedType)
     : base(aspectDefinition, aspectWeavingSettings, weavedType)
 {
 }
 internal AbstractRaiseEventInterceptionAspectWeaver(IEventAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings, FieldInfo weavedType)
     : base(aspectDefinition, aspectWeavingSettings, weavedType)
 {
 }
 internal BindingAddEventAspectDecoratorExpression(IEventAspectDefinition aspectDefinition)
 {
     this.aspectDefinition = aspectDefinition;
 }
 public TopRemoveEventFragmentInterceptionAspectExpression(IAspectExpression aspectExpression, IEventAspectDefinition aspectDefinition, IBindingTypeReflectorBuilder eventBuilder)
     : base(aspectExpression, eventBuilder, aspectDefinition)
 {
 }
 internal BindingRaiseEventAspectDecoratorExpression(IEventAspectDefinition aspectDefinition)
 {
     this.aspectDefinition = aspectDefinition;
 }
 internal AbstractEventAspectArgumentsWeaver(IEventAspectDefinition aspectDefinition, IArgumentsWeavingSettings argumentWeavingSettings, IAspectWeavingSettings aspectWeavingSettings, BindingSettings bindingSettings)
     : base(aspectDefinition.Member, argumentWeavingSettings, aspectWeavingSettings)
 {
     this.bindingSettings  = bindingSettings;
     this.aspectDefinition = aspectDefinition;
 }
 internal EventBindingTypeReflectorBuilder(IEventAspectDefinition aspectDefinition)
 {
     lazyBindingTypeReflector = new Core.Lib.Lazy<IAspectExpression, IAspectExpression, IAspectExpression, IAspectWeavingSettings, IBindingTypeReflector>((addAspectExpression, removeAspectExpression, invokeAspectExpression, aspectWeavingSettings) => {
         return new IsolatedEventInterceptionBindingWeaver(addAspectExpression, removeAspectExpression, invokeAspectExpression, aspectDefinition, aspectWeavingSettings);
     });
 }
Пример #13
0
 internal AbstractAspectEventExpression(IAspectExpression aspectExpression, IEventAspectDefinition aspectDefinition = null)
 {
     this.aspectExpression = aspectExpression;
     this.aspectDefinition = aspectDefinition;
 }
Пример #14
0
 internal static Type ToAspectArgumentImpl(this IEventAspectDefinition aspectDefinition)
 {
     return(aspectDefinition.ToAspectArgumentImpl(aspectDefinition.Member.GetAddMethod()));
 }
Пример #15
0
 internal TopEventInterceptionArgumentsWeaver(IEventAspectDefinition aspectDefinition, IArgumentsWeavingSettings argumentWeavingSettings, IAspectWeavingSettings aspectWeavingSettings, BindingSettings bindingSettings)
     : base(aspectDefinition, argumentWeavingSettings, aspectWeavingSettings, bindingSettings)
 {
 }
 internal BindingEventInterceptionArgumentsWeaver(IEventAspectDefinition aspectDefinition, IArgumentsWeavingSettings argumentWeavingSettings, IAspectWeavingSettings aspectWeavingSettings, BindingSettings bindingSettings)
     : base(aspectDefinition, argumentWeavingSettings, aspectWeavingSettings, bindingSettings)
 {
 }
 internal AbstractEventFragmentAspectExpression(IAspectExpression aspectExpression, IBindingTypeReflectorBuilder eventBuilder, IEventAspectDefinition aspectDefinition = null)
     : base(aspectExpression, aspectDefinition)
 {
     this.eventBuilder = eventBuilder;
 }
 public TopRemoveEventFragmentInterceptionAspectExpression(IAspectExpression aspectExpression, IEventAspectDefinition aspectDefinition, IBindingTypeReflectorBuilder eventBuilder)
     : base(aspectExpression, eventBuilder, aspectDefinition)
 {
 }
 internal AbstractEventFragmentAspectExpression(IAspectExpression aspectExpression, IBindingTypeReflectorBuilder eventBuilder, IEventAspectDefinition aspectDefinition = null)
     : base(aspectExpression, aspectDefinition)
 {
     this.eventBuilder = eventBuilder;
 }
Пример #20
0
 internal EventBindingTypeReflectorBuilder(IEventAspectDefinition aspectDefinition)
 {
     lazyBindingTypeReflector = new Core.Lib.Lazy <IAspectExpression, IAspectExpression, IAspectExpression, IAspectWeavingSettings, IBindingTypeReflector>((addAspectExpression, removeAspectExpression, invokeAspectExpression, aspectWeavingSettings) => {
         return(new IsolatedEventInterceptionBindingWeaver(addAspectExpression, removeAspectExpression, invokeAspectExpression, aspectDefinition, aspectWeavingSettings));
     });
 }
 internal AbstractAspectEventExpression(IAspectExpression aspectExpression, IEventAspectDefinition aspectDefinition = null)
 {
     this.aspectExpression = aspectExpression;
     this.aspectDefinition = aspectDefinition;
 }