Esempio n. 1
0
 internal TopSetPropertyInterceptionAspectWeaver(IPropertyAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings, FieldInfo weavedType)
     : base(aspectDefinition, aspectWeavingSettings, weavedType)
 {
     argumentsWeavingSettings.BindingsDependency = weavedType;
     argumentsWeavingSettings.Parameters         = new[] { aspectDefinition.Member.PropertyType };
     argumentsWeaver = new TopSetPropertyInterceptionArgumentsWeaver(aspectDefinition.Member, argumentsWeavingSettings, aspectWeavingSettings);
     weaver          = new MethodScopeWeaversQueue(methodScopeWeavers);
 }
 internal TopSetPropertyInterceptionAspectWeaver(IPropertyAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings, FieldInfo weavedType)
     : base(aspectDefinition, aspectWeavingSettings, weavedType)
 {
     argumentsWeavingSettings.BindingsDependency = weavedType;
     argumentsWeavingSettings.Parameters = new[] { aspectDefinition.Member.PropertyType };
     argumentsWeaver = new TopSetPropertyInterceptionArgumentsWeaver(aspectDefinition.Member, argumentsWeavingSettings, aspectWeavingSettings);
     weaver = new MethodScopeWeaversQueue(methodScopeWeavers);
 }
Esempio n. 3
0
        internal static Type ToAspectArgumentImpl(this IPropertyAspectDefinition aspectDefinition)
        {
            var property = aspectDefinition.Member;
            var method   = aspectDefinition.IsGetPropertyAspectDefinition() ?
                           property.GetGetMethod() :
                           property.GetSetMethod();

            return(aspectDefinition.ToAspectArgumentImpl(method));
        }
        internal BindingSetPropertyInterceptionAspectWeaver(IPropertyAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings, FieldInfo weavedType)
            : base(aspectDefinition, aspectWeavingSettings, weavedType)
        {
            IMethodScopeWeaver finallyWeaver = null;

            argumentsWeavingSettings.BindingsDependency = weavedType;
            argumentsWeavingSettings.Parameters = new[] { aspectDefinition.Member.PropertyType };
            finallyWeaver = new FinallyBindingPropertyAspectWeaver(aspectDefinition.Member, argumentsWeavingSettings, aspectWeavingSettings);
            argumentsWeaver = new BindingSetPropertyInterceptionArgumentsWeaver(aspectDefinition.Member, argumentsWeavingSettings, aspectWeavingSettings);
            weaver = new TryFinallyAspectWeaver(methodScopeWeavers, new[] { finallyWeaver });
        }
        internal BindingSetPropertyInterceptionAspectWeaver(IPropertyAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings, FieldInfo weavedType)
            : base(aspectDefinition, aspectWeavingSettings, weavedType)
        {
            IMethodScopeWeaver finallyWeaver = null;

            argumentsWeavingSettings.BindingsDependency = weavedType;
            argumentsWeavingSettings.Parameters         = new[] { aspectDefinition.Member.PropertyType };
            finallyWeaver   = new FinallyBindingPropertyAspectWeaver(aspectDefinition.Member, argumentsWeavingSettings, aspectWeavingSettings);
            argumentsWeaver = new BindingSetPropertyInterceptionArgumentsWeaver(aspectDefinition.Member, argumentsWeavingSettings, aspectWeavingSettings);
            weaver          = new TryFinallyAspectWeaver(methodScopeWeavers, new[] { finallyWeaver });
        }
Esempio n. 6
0
        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)
            });
        }
Esempio n. 7
0
        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());
        }
Esempio n. 8
0
        internal static BindingSettings ToBindingSettings(this IAspectDefinition aspectDefinition)
        {
            IPropertyAspectDefinition propertyAspectDefinition = null;
            var methodAspectDefinition = aspectDefinition as IMethodAspectDefinition;

            if (methodAspectDefinition.IsNotNull())
            {
                return(methodAspectDefinition.ToMethodBindingSettings());
            }

            propertyAspectDefinition = aspectDefinition as IPropertyAspectDefinition;

            if (propertyAspectDefinition.IsNotNull())
            {
                return(propertyAspectDefinition.ToPropertyBindingSettings());
            }

            return(((IEventAspectDefinition)aspectDefinition).ToEventBindingSettings());
        }
 internal AbstractPartialAspectPropertyExpression(IAspectExpression aspectExpression, IPropertyAspectDefinition aspectDefinition = null)
     : base(aspectDefinition)
 {
     this.aspectExpression = aspectExpression;
 }
 internal AbstractPartialPropertyInterceptionBindingWeaver(IAspectExpression aspectExpression, IPropertyAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings)
     : base(aspectDefinition, aspectWeavingSettings)
 {
     this.aspectExpression = aspectExpression;
 }
Esempio n. 11
0
 public SetPropertyBindingTypeReflectorBuilder(IPropertyAspectDefinition aspectDefinition)
 {
     lazyBindingTypeReflector = new Core.Lib.Lazy <IAspectExpression, IAspectWeavingSettings, IBindingTypeReflector>((setAspectExpression, aspectWeavingSettings) => {
         return(new IsolatedSetPropertyInterceptionBindingWeaver(setAspectExpression, aspectDefinition, aspectWeavingSettings));
     });
 }
 internal AbstractPartialAspectPropertyExpression(IAspectExpression aspectExpression, IPropertyAspectDefinition aspectDefinition = null)
     : base(aspectDefinition)
 {
     this.aspectExpression = aspectExpression;
 }
 internal AbstractPropertyInterceptionBindingWeaver(IPropertyAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings)
     : base(aspectDefinition)
 {
     this.aspectWeavingSettings = aspectWeavingSettings;
     lazyWeavedType = new Core.Lib.Lazy<FieldInfo>(WeaveType);
 }
 internal IsolatedGetPropertyInterceptionBindingWeaver(IAspectExpression aspectExpression, IPropertyAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings)
     : base(aspectExpression, aspectDefinition, aspectWeavingSettings)
 {
 }
 internal AbstractPartialPropertyInterceptionBindingWeaver(IAspectExpression aspectExpression, IPropertyAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings)
     : base(aspectDefinition, aspectWeavingSettings)
 {
     this.aspectExpression = aspectExpression;
 }
 internal IsolatedFullPropertyInterceptionBindingWeaver(IAspectExpression getAspectExpression, IAspectExpression setAspectExpression, IPropertyAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings)
     : base(aspectDefinition, aspectWeavingSettings)
 {
     this.getAspectExpression = getAspectExpression;
     this.setAspectExpression = setAspectExpression;
 }
Esempio n. 17
0
 internal TopGetPropertyInterceptionAspectExpression(IAspectExpression aspectExpression, IPropertyAspectDefinition aspectDefinition = null)
     : base(aspectExpression, aspectDefinition)
 {
 }
 internal BindingSetPropertyAspectDecoratorExpression(IPropertyAspectDefinition aspectDefinition)
 {
     this.aspectDefinition = aspectDefinition;
 }
Esempio n. 19
0
 internal AbstractPropertyInterceptionBindingWeaver(IPropertyAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings)
     : base(aspectDefinition)
 {
     this.aspectWeavingSettings = aspectWeavingSettings;
     lazyWeavedType             = new Core.Lib.Lazy <FieldInfo>(WeaveType);
 }
 internal TopSetPropertyFragmentInterceptionAspectExpression(IAspectExpression aspectExpression, IPropertyAspectDefinition aspectDefinition, IBindingTypeReflectorBuilder propertyBuilder)
     : base(aspectExpression, propertyBuilder, aspectDefinition)
 {
 }
Esempio n. 21
0
 internal AbstractAspectPropertyExpression(IPropertyAspectDefinition aspectDefinition = null)
 {
     this.aspectDefinition = aspectDefinition;
 }
 internal IsolatedFullPropertyInterceptionBindingWeaver(IAspectExpression getAspectExpression, IAspectExpression setAspectExpression, IPropertyAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings)
     : base(aspectDefinition, aspectWeavingSettings)
 {
     this.getAspectExpression = getAspectExpression;
     this.setAspectExpression = setAspectExpression;
 }
Esempio n. 23
0
 internal BindingSetPropertyAspectDecoratorExpression(IPropertyAspectDefinition aspectDefinition)
 {
     this.aspectDefinition = aspectDefinition;
 }
 public SetPropertyBindingTypeReflectorBuilder(IPropertyAspectDefinition aspectDefinition)
 {
     lazyBindingTypeReflector = new Core.Lib.Lazy<IAspectExpression, IAspectWeavingSettings, IBindingTypeReflector>((setAspectExpression, aspectWeavingSettings) => {
         return new IsolatedSetPropertyInterceptionBindingWeaver(setAspectExpression, aspectDefinition, aspectWeavingSettings);
     });
 }
 internal AbstractPartialPropertyFragmentAspectExpression(IAspectExpression aspectExpression, IBindingTypeReflectorBuilder propertyBuilder, IPropertyAspectDefinition aspectDefinition = null)
     : base(aspectExpression, aspectDefinition)
 {
     this.propertyBuilder = propertyBuilder;
 }
 internal AbstractPartialPropertyFragmentAspectExpression(IAspectExpression aspectExpression, IBindingTypeReflectorBuilder propertyBuilder, IPropertyAspectDefinition aspectDefinition = null)
     : base(aspectExpression, aspectDefinition)
 {
     this.propertyBuilder = propertyBuilder;
 }
Esempio n. 27
0
 internal BindingGetPropertyFragmentInterceptionAspectExpression(IAspectExpression aspectExpression, IPropertyAspectDefinition aspectDefinition, IBindingTypeReflectorBuilder propertyBuilder)
     : base(aspectExpression, propertyBuilder, aspectDefinition)
 {
 }
 internal IsolatedGetPropertyInterceptionBindingWeaver(IAspectExpression aspectExpression, IPropertyAspectDefinition aspectDefinition, IAspectWeavingSettings aspectWeavingSettings)
     : base(aspectExpression, aspectDefinition, aspectWeavingSettings)
 {
 }
 internal AbstractAspectPropertyExpression(IPropertyAspectDefinition aspectDefinition = null)
 {
     this.aspectDefinition = aspectDefinition;
 }
 internal BindingSetPropertyInterceptionAspectExpression(IAspectExpression aspectExpression, IPropertyAspectDefinition aspectDefinition = null)
     : base(aspectExpression, aspectDefinition)
 {
 }