public RemoveEventDecoratorWeaver(IEventTypeBuilder eventTypeBuilder, EventInfo @event, IWeavingSettings weavingSettings)
     : base(@event.GetRemoveMethod(), weavingSettings)
 {
     MethodEndWeaver = new MethodEndWeaver();
     MethodScopeWeaver = new RemoveEventDecoratorScopeWeaver(method, weavingSettings);
     MethodDefintionWeaver = new RemoveEventMethodSignatureWeaver(eventTypeBuilder, weavingSettings.TypeDefinition);
 }
Esempio n. 2
0
 public MethodDecoratorWeaver(IWeavingSettings weavingSettings)
     : base(weavingSettings)
 {
     MethodEndWeaver       = new MethodEndWeaver();
     MethodScopeWeaver     = new MethodDecoratorScopeWeaver(weavingSettings);
     MethodDefintionWeaver = new MethodSignatureWeaver(weavingSettings.TypeDefinition);
 }
 public SetPropertyDecoratorWeaver(MethodInfo method, IWeavingSettings weavingSettings)
     : base(method, weavingSettings)
 {
     MethodEndWeaver       = new MethodEndWeaver();
     MethodScopeWeaver     = new SetPropertyDecoratorScopeWeaver(method, weavingSettings);
     MethodDefintionWeaver = new SetPropertySignatureWeaver(weavingSettings.TypeDefinition);
 }
Esempio n. 4
0
 public MethodDecoratorWeaver(MethodInfo method, IWeavingSettings weavingSettings)
     : base(method, weavingSettings)
 {
     MethodEndWeaver = new MethodEndWeaver();
     MethodScopeWeaver = new MethodDecoratorScopeWeaver(method, weavingSettings);
     MethodDefintionWeaver = new MethodSignatureWeaver(weavingSettings.TypeDefinition);
 }
Esempio n. 5
0
 internal CompositeMethodWeaver(IAspectDefinitionCollection aspectDefinition, IWeavingSettings weavingSettings)
     : base(weavingSettings)
 {
     methodWeaver          = new AspectMethodWeaver(aspectDefinition, weavingSettings);
     MethodDefintionWeaver = methodWeaver.MethodDefintionWeaver;
     MethodScopeWeaver     = methodWeaver.MethodScopeWeaver;
     MethodEndWeaver       = methodWeaver.MethodEndWeaver;
 }
Esempio n. 6
0
        public AspectMethodWeaver(IAspectDefinitionCollection aspectDefinitions, IWeavingSettings weavingSettings)
            : base(weavingSettings)
        {
            var aspectExpression = new AspectExpressionTreeBuilder(aspectDefinitions, weavingSettings).Build();

            MethodEndWeaver       = new MethodEndWeaver();
            MethodScopeWeaver     = aspectExpression.Reduce(AspectWeavingSettingsImpl.Empty);
            MethodDefintionWeaver = new MethodSignatureWeaver(weavingSettings.TypeDefinition);
        }
 internal AbstractMethodAspectWeaver(IAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWevingSettings)
 {
     advices = aspectDefinition.Advices;
     this.aspectDefinition      = aspectDefinition;
     this.aspectWeavingSettings = aspectWevingSettings;
     weavingSettings            = aspectWevingSettings.WeavingSettings;
     aspectRepository           = aspectWevingSettings.AspectRepository;
     argumentsWeavingSetings    = aspectDefinition.ToArgumentsWeavingSettings();
     aspectDefinition.Advices.ForEach(advice => advice.Accept(adviceDiscoveryVistor));
 }
Esempio n. 8
0
 internal AbstractAspectWeaver(IAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings)
 {
     advices = aspectDefinition.Advices;
     this.aspectDefinition = aspectDefinition;
     this.aspectWeavingSettings = aspectWeavingSettings;
     bindingSettings = aspectDefinition.ToBindingSettings();
     weavingSettings = aspectWeavingSettings.WeavingSettings;
     aspectRepository = aspectWeavingSettings.AspectRepository;
     argumentsWeavingSettings = aspectDefinition.ToArgumentsWeavingSettings();
     aspectDefinition.Advices.ForEach(advice => advice.Accept(adviceDiscoveryVistor));
 }
Esempio n. 9
0
        internal AbstractAspectArgsMappingWeaver(IAspectWeavingSettings aspectWeavingSettings, IArgumentsSettings argumentsSettings)
        {
            Type[] @params = null;

            this.argumentsSettings     = argumentsSettings;
            this.aspectWeavingSettings = aspectWeavingSettings;
            aspectArgumentType         = argumentsSettings.ArgumentType;
            weavingSettings            = aspectWeavingSettings.WeavingSettings;
            localBuilderRepository     = aspectWeavingSettings.LocalBuilderRepository;
            @params           = argumentsSettings.ArgumentType.GetGenericArguments();
            parameters        = argumentsSettings.Parameters;
            mappingParameters = @params.Skip(1).ToArray();
        }
        internal AbstractAspectArgsMappingWeaver(IAspectWeavingSettings aspectWeavingSettings, IArgumentsSettings argumentsSettings)
        {
            Type[] @params = null;

            this.argumentsSettings = argumentsSettings;
            this.aspectWeavingSettings = aspectWeavingSettings;
            aspectArgumentType = argumentsSettings.ArgumentType;
            weavingSettings = aspectWeavingSettings.WeavingSettings;
            localBuilderRepository = aspectWeavingSettings.LocalBuilderRepository;
            @params = argumentsSettings.ArgumentType.GetGenericArguments();
            parameters = argumentsSettings.Parameters;
            mappingParameters = @params.Skip(1).ToArray();
        }
        internal AspectExpressionTreeBuilder(IAspectDefinitionCollection aspectDefinitions, IWeavingSettings weavingSettings)
        {
            var aspectVisitor = new AspectVisitor();
            IAspectDefinition               firstAspectDefinition    = null;
            IAspectExpressionBuilder        invocationAspectBuilder  = null;
            IArgumentsWeavingSettings       argumentsWeavingSettings = null;
            List <IAspectExpressionBuilder> aspectExpressionBuilders = null;

            var aspectsByPriority = aspectDefinitions.OrderBy(aspect => aspect.Aspect.AspectPriority)
                                    .ThenBy(aspect => {
                var value = aspect.Aspect is OnMethodBoundaryAspectAttribute;
                return(Convert.ToInt32(!value));
            });

            this.weavingSettings     = weavingSettings;
            this.aspectsDefinitions  = aspectDefinitions;
            firstAspectDefinition    = aspectDefinitions.First();
            argumentsWeavingSettings = firstAspectDefinition.ToArgumentsWeavingSettings();
            aspectExpressionBuilders = aspectsByPriority.ToList(definition => definition.Accept(aspectVisitor));
            invocationAspectBuilder  = aspectVisitor.VisitInvocation(firstAspectDefinition, argumentsWeavingSettings);
            aspectExpressionBuilders.Add(invocationAspectBuilder);
            aspectsStack = new Stack <IAspectExpressionBuilder>(aspectExpressionBuilders);
        }
Esempio n. 12
0
        public AspectsWeaver(IAspectExpression aspectExpression, IAspectDefinitionCollection aspectDefinitions, IWeavingSettings weavingSettings)
        {
            this.aspectExpression  = aspectExpression;
            aspectArgsMapperWeaver = new AspectArgsMapperWeaver();
            aspectAttributeWeaver  = new AspectsAttributeWeaver(aspectDefinitions);

            settings = new AspectWeavingSettingsImpl {
                WeavingSettings  = weavingSettings,
                AspectRepository = aspectAttributeWeaver,
                AspectArgsMapper = aspectArgsMapperWeaver
            };
        }
 public RemoveEventDecoratorScopeWeaver(MethodInfo method, IWeavingSettings weavingSettings)
     : base(method, weavingSettings)
 {
 }
Esempio n. 14
0
 public MethodDecoratorScopeWeaver(IWeavingSettings weavingSettings)
     : base(weavingSettings)
 {
 }
 public SetPropertyDecoratorScopeWeaver(MethodInfo method, IWeavingSettings weavingSettings)
     : base(method, weavingSettings)
 {
 }
 public RemoveEventDecoratorScopeWeaver(MethodInfo method, IWeavingSettings weavingSettings)
     : base(method, weavingSettings)
 {
 }
Esempio n. 17
0
 protected AbstractMethodWeaver(MethodInfo method, IWeavingSettings weavingSettings)
 {
     this.method          = method;
     this.weavingSettings = weavingSettings;
 }
Esempio n. 18
0
 public AbstractMethodWeaver(IWeavingSettings weavingSettings)
 {
     this.weavingSettings = weavingSettings;
 }
 public SetPropertyDecoratorScopeWeaver(MethodInfo method, IWeavingSettings weavingSettings)
     : base(method, weavingSettings)
 {
 }
 internal AbstractBranchedMethodScopeWeaver(MethodInfo method, IWeavingSettings weavingSettings)
     : base(method, weavingSettings)
 {
 }
 protected AbstractAddRemoveEventMethodScopeWeaver(MethodInfo method, IWeavingSettings weavingSettings)
     : base(method, weavingSettings)
 {
 }
Esempio n. 22
0
 internal AbstractBranchedMethodScopeWeaver(IWeavingSettings weavingSettings)
     : base(weavingSettings)
 {
 }
Esempio n. 23
0
 protected AbstractMethodWeaver(MethodInfo method, IWeavingSettings weavingSettings)
 {
     this.method = method;
     this.weavingSettings = weavingSettings;
 }
 public PropertySetDecoratorScopeWeaver(IWeavingSettings weavingSettings)
     : base(weavingSettings)
 {
 }
Esempio n. 25
0
 internal AspectExpression(IAspectExpression aspectExpression, IAspectDefinitionCollection aspectsDefinitions, IWeavingSettings weavingSettings)
 {
     this.weavingSettings    = weavingSettings;
     this.aspectExpression   = aspectExpression;
     this.aspectsDefinitions = aspectsDefinitions;
 }
Esempio n. 26
0
 internal AbstractBranchedMethodScopeWeaver(MethodInfo method, IWeavingSettings weavingSettings)
     : base(method, weavingSettings)
 {
 }
 public AddEventDecoratorWeaver(IEventTypeBuilder eventTypeBuilder, EventInfo @event, IWeavingSettings weavingSettings)
     : base(@event.GetAddMethod(), weavingSettings)
 {
     MethodEndWeaver       = new MethodEndWeaver();
     MethodScopeWeaver     = new AddEventDecoratorScopeWeaver(method, weavingSettings);
     MethodDefintionWeaver = new AddEventMethodSignatureWeaver(eventTypeBuilder, weavingSettings.TypeDefinition);
 }
Esempio n. 28
0
 protected AbstractAddRemoveEventMethodScopeWeaver(MethodInfo method, IWeavingSettings weavingSettings)
     : base(method, weavingSettings)
 {
 }