예제 #1
0
 public TryFinallyAspectWeaver(IEnumerable<IMethodScopeWeaver> tryWeavers, IEnumerable<IMethodScopeWeaver> finallyWeavers, IMethodScopeWeaver returnValueWeaver = null)
 {
     this.tryWeavers = tryWeavers;
     this.finallyWeavers = finallyWeavers;
     weavers = new List<IMethodScopeWeaver>();
     this.returnValueWeaver = returnValueWeaver;
 }
예제 #2
0
 internal AbstractMethodBindingWeaver(MethodInfo method, BindingSettings bindingSettings, IAspectWeavingSettings aspectWeavingSettings, IMethodScopeWeaver methodScopeWeaver)
 {
     this.method = method;
     this.bindingSettings = bindingSettings;
     this.methodScopeWeaver = methodScopeWeaver;
     this.aspectWeavingSettings = aspectWeavingSettings;
 }
        internal BindingMethodAspectDecoratorWeaver(IMethodAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings, IArgumentsWeavingSettings argumentsWeavingSettings)
            : base(aspectDefinition.Member, aspectWeavingSettings.WeavingSettings)
        {
            var bindingSettings = aspectDefinition.ToBindingSettings();

            methodDecoratorScopeWeaver = new MethodDecoratorScopeWeaver(aspectDefinition.Member, aspectWeavingSettings);
            weaver = new MethodDecoratorBindingWeaver(aspectDefinition.Member, bindingSettings, aspectWeavingSettings, this);
        }
        internal BindingMethodAspectDecoratorWeaver(IMethodAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings, IArgumentsWeavingSettings argumentsWeavingSettings)
            : base(aspectDefinition.Member, aspectWeavingSettings.WeavingSettings)
        {
            var bindingSettings = aspectDefinition.ToBindingSettings();

            methodDecoratorScopeWeaver = new MethodDecoratorScopeWeaver(aspectDefinition.Member, aspectWeavingSettings);
            weaver = new MethodDecoratorBindingWeaver(aspectDefinition.Member, bindingSettings, aspectWeavingSettings, this);
        }
 internal AbstractPropertyBindingWeaver(PropertyInfo property, BindingSettings bindingSettings, IAspectWeavingSettings aspectWeavingSettings, IMethodScopeWeaver getMethodScopeWeaver = null, IMethodScopeWeaver setMethodScopeWeaver = null)
 {
     this.property = property;
     this.bindingSettings = bindingSettings;
     this.getMethodScopeWeaver = getMethodScopeWeaver;
     this.setMethodScopeWeaver = setMethodScopeWeaver;
     this.aspectWeavingSettings = aspectWeavingSettings;
 }
예제 #6
0
 internal AbstractPropertyBindingWeaver(PropertyInfo property, BindingSettings bindingSettings, IAspectWeavingSettings aspectWeavingSettings, IMethodScopeWeaver getMethodScopeWeaver = null, IMethodScopeWeaver setMethodScopeWeaver = null)
 {
     this.property              = property;
     this.bindingSettings       = bindingSettings;
     this.getMethodScopeWeaver  = getMethodScopeWeaver;
     this.setMethodScopeWeaver  = setMethodScopeWeaver;
     this.aspectWeavingSettings = aspectWeavingSettings;
 }
예제 #7
0
        protected virtual void WeaveHandlerMethod(string methodName, IMethodScopeWeaver methodScopeWeaver, Type returnType)
        {
            var methodBuilder = typeBuilder.DefineMethod(methodName, methodAttr, callingConventions, returnType, methodParameters.Parameters);
            var ilGenerator   = methodBuilder.GetILGenerator();

            methodScopeWeaver.Weave(ilGenerator);
            ilGenerator.Emit(OpCodes.Ret);
        }
예제 #8
0
        protected AbstractAspectMethodWeaver(MethodInfo method, IAspectDefinitionCollection aspectDefinitions, IAspectWeavingSettings aspectWeavingSettings)
        {
            IAspectExpression aspectExpression = null;
            var aspectExpressionBuilder        = new AspectExpressionTreeBuilder(aspectDefinitions);

            this.method       = method;
            methodEndWeaver   = new MethodEndWeaver();
            aspectExpression  = aspectExpressionBuilder.Build();
            methodScopeWeaver = aspectExpression.Reduce(aspectWeavingSettings);
        }
예제 #9
0
 public EventInterceptionBindingWeaver(EventInfo @event, BindingSettings bindingSettings, IAspectWeavingSettings aspectWeavingSettings, IAspectWeaver addMethodScopeWeaver, IAspectWeaver removeMethodScopeWeaver, IAspectWeaver invokeMethodScopeWeaver)
 {
     this.@event                  = @event;
     this.bindingSettings         = bindingSettings;
     this.addMethodScopeWeaver    = addMethodScopeWeaver;
     this.aspectWeavingSettings   = aspectWeavingSettings;
     this.removeMethodScopeWeaver = removeMethodScopeWeaver;
     this.invokeMethodScopeWeaver = invokeMethodScopeWeaver;
     ResolveParameterTypes();
 }
 public EventInterceptionBindingWeaver(EventInfo @event, BindingSettings bindingSettings, IAspectWeavingSettings aspectWeavingSettings, IAspectWeaver addMethodScopeWeaver, IAspectWeaver removeMethodScopeWeaver, IAspectWeaver invokeMethodScopeWeaver)
 {
     this.@event = @event;
     this.bindingSettings = bindingSettings;
     this.addMethodScopeWeaver = addMethodScopeWeaver;
     this.aspectWeavingSettings = aspectWeavingSettings;
     this.removeMethodScopeWeaver = removeMethodScopeWeaver;
     this.invokeMethodScopeWeaver = invokeMethodScopeWeaver;
     ResolveParameterTypes();
 }
예제 #11
0
        protected AbstractAspectMethodWeaver(MethodInfo method, IAspectDefinitionCollection aspectDefinitions, IAspectWeavingSettings aspectWeavingSettings)
        {
            IAspectExpression aspectExpression = null;
            var aspectExpressionBuilder = new AspectExpressionTreeBuilder(aspectDefinitions);

            this.method = method;
            methodEndWeaver = new MethodEndWeaver();
            aspectExpression = aspectExpressionBuilder.Build();
            methodScopeWeaver = aspectExpression.Reduce(aspectWeavingSettings);
        }
 protected virtual void OnFunctionWeavingDetected()
 {
     returnValueWeaver = new TopGetReturnValueWeaver(aspectWeavingSettings, argumentsWeavingSettings);
 }
        protected virtual void WeaveHandlerMethod(string methodName, IMethodScopeWeaver methodScopeWeaver, Type returnType)
        {
            var methodBuilder = typeBuilder.DefineMethod(methodName, methodAttr, callingConventions, returnType, methodParameters.Parameters);
            var ilGenerator = methodBuilder.GetILGenerator();

            methodScopeWeaver.Weave(ilGenerator);
            ilGenerator.Emit(OpCodes.Ret);
        }
 internal BindingGetPropertyAspectDecoratorWeaver(PropertyInfo property, IAspectWeavingSettings aspectWeavingSettings)
     : base(property.GetGetMethod(), aspectWeavingSettings.WeavingSettings)
 {
     weaver = new GetPropertyDecoratorScopeWeaver(property, aspectWeavingSettings);
 }
예제 #15
0
 internal TryCatchFinallyAspectWeaver(TryCatchFinallySettings tryCatchFinallySettings, IEnumerable<IMethodScopeWeaver> entryWeavers, IEnumerable<IMethodScopeWeaver> tryWeavers, IEnumerable<IMethodScopeWeaver> catchWeavers, IEnumerable<IMethodScopeWeaver> finallyWeavers, IMethodScopeWeaver returnValueWeaver = null)
     : base(entryWeavers, tryWeavers, finallyWeavers, returnValueWeaver)
 {
     this.catchWeavers = catchWeavers;
     this.tryCatchFinallySettings = tryCatchFinallySettings;
 }
 internal PropertyDecorationBindingWeaver(PropertyInfo property, BindingSettings bindingSettings, IAspectWeavingSettings aspectWeavingSettings, IMethodScopeWeaver methodScopeWeaver)
     : base(property, bindingSettings, aspectWeavingSettings, methodScopeWeaver)
 {
 }
 public OnMethodBoundaryTryFinallyAspectWeaver(IEnumerable<IMethodScopeWeaver> entryWeavers, IEnumerable<IMethodScopeWeaver> tryWeavers, IEnumerable<IMethodScopeWeaver> finallyWeavers, IMethodScopeWeaver returnValueWeaver = null)
     : base(tryWeavers, finallyWeavers, returnValueWeaver)
 {
     this.entryWeavers = entryWeavers;
 }
 internal MethodDecoratorBindingWeaver(MethodInfo method, BindingSettings bindingSettings, IAspectWeavingSettings aspectWeavingSettings, IMethodScopeWeaver methodScopeWeaver)
     : base(method, bindingSettings, aspectWeavingSettings, methodScopeWeaver)
 {
 }
 internal PropertyDecorationBindingWeaver(PropertyInfo property, BindingSettings bindingSettings, IAspectWeavingSettings aspectWeavingSettings, IMethodScopeWeaver methodScopeWeaver)
     : base(property, bindingSettings, aspectWeavingSettings, methodScopeWeaver)
 {
 }
 internal MethodDecoratorBindingWeaver(BindingSettings bindingSettings, IAspectWeavingSettings aspectWeavingSettings, IMethodScopeWeaver methodScopeWeaver)
     : base(bindingSettings, aspectWeavingSettings, methodScopeWeaver)
 {
 }
예제 #21
0
 internal TryCatchFinallyAspectWeaver(TryCatchFinallySettings tryCatchFinallySettings, IMethodScopeWeaver entryWeaver, IEnumerable <IMethodScopeWeaver> tryWeavers, IMethodScopeWeaver catchWeaver, IEnumerable <IMethodScopeWeaver> finallyWeavers, IMethodScopeWeaver returnValueWeaver = null)
     : base(entryWeaver, tryWeavers, finallyWeavers, returnValueWeaver)
 {
     this.catchWeaver             = catchWeaver;
     this.tryCatchFinallySettings = tryCatchFinallySettings;
 }