public override void ProvideAspectTransformations(AspectWeaverTransformationAdder adder)
            {
                LoggingAspectTransformation transformation = ((LoggingAspectWeaver)AspectWeaver).transformation;
                AspectWeaverTransformationInstance transformationInstance = transformation.CreateInstance(this);

                adder.Add(TargetElement, transformationInstance);
            }
            public override void ProvideAspectTransformations(AspectWeaverTransformationAdder adder)
            {
                LoggingAspectTransformation        transformation         = ((LoggingAspectWeaver)AspectWeaver).transformation;
                AspectWeaverTransformationInstance transformationInstance = transformation.CreateInstance(this);

                adder.Add(TargetElement, transformationInstance);
            }
            public override void ProvideAspectTransformations(AspectWeaverTransformationAdder adder)
            {
                var aspectWeaver = (GuardPropertyEqualityAspectWeaver) AspectWeaver;
                var property = (PropertyDeclaration) TargetElement;
                if(aspectWeaver._transformation == null) return;

                adder.Add(property.Setter, aspectWeaver._transformation.CreateInstance(property, this));
            }
            public override void ProvideAspectTransformations(AspectWeaverTransformationAdder adder)
            {
                // Find the MoveNext method.
                TypeDefDeclaration   targetType     = (TypeDefDeclaration)this.aspectInstanceInfo.TargetElement;
                MethodDefDeclaration moveNextMethod = targetType.Methods.Single <MethodDefDeclaration>(m => m.Name.EndsWith("MoveNext"));

                adder.Add(moveNextMethod, this.parent.moveNextTransformation.CreateInstance(this));
            }
Пример #5
0
 public override void ProvideAspectTransformations(AspectWeaverTransformationAdder adder)
 {
 }
 public override void ProvideAspectTransformations(AspectWeaverTransformationAdder adder)
 {
     adder.Add(this.TargetElement, this.parent.transformation.CreateInstance(this));
 }
 public override void ProvideAspectTransformations( AspectWeaverTransformationAdder adder )
 {
     adder.Add( this.TargetElement, this.parent.transformation.CreateInstance(this) );
 }
 public override void ProvideAspectTransformations(AspectWeaverTransformationAdder adder)
 {
     var type = this.TargetElement as IType;
     if(type == null) return;
     var aspectWeaver = _concreteAspectWeaver;
     adder.Add(type, aspectWeaver._transformation.CreateInstance(type, this));
 }
 public override void ProvideTransformations(AspectWeaverInstance aspectWeaverInstance, AspectWeaverTransformationAdder adder)
 {
     if (_enhanceSetterTransformationOptions == null || !_enhanceSetterTransformationOptions.ShouldTransform()) return;
     var type = aspectWeaverInstance.TargetElement as IType;
     if (type == null) return;
     var typeDef = type.GetTypeDefinition();
     //Get all non-static properties declared on this type
     var method = typeDef.GetMethodsBySignature(_enhanceSetterTransformationOptions.Signatures);
     var properties =
         from property in typeDef.Properties
         where property.CanWrite
               && property.CanRead
               && !property.IsStatic
               && property.DeclaringType != null
               && property.DeclaringType.Equals(typeDef)
         select property;
     foreach (var property in properties) {
         var txContext = new EnhanceSetterTransformationContext(property, _enhanceSetterTransformationOptions);
         //TODO: If NoChangeNotification attribute is specified then skip this transformation
         adder.Add(property.Setter,
                 _enhancePropertySetterMethodBodyTransformation.CreateInstance(txContext, aspectWeaverInstance));
     }
 }