Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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;
 }
Exemplo n.º 18
0
 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)
 {
 }
Exemplo n.º 20
0
 internal MethodDecoratorBindingWeaver(BindingSettings bindingSettings, IAspectWeavingSettings aspectWeavingSettings, IMethodScopeWeaver methodScopeWeaver)
     : base(bindingSettings, aspectWeavingSettings, methodScopeWeaver)
 {
 }
Exemplo n.º 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;
 }