public void Weave(PropertyDefinition property, ExtensionPointAttribute extensionPoint) { var type = property.DeclaringType; LogInfo($"Weaving property get interceptor {extensionPoint.AttributeType.FullName} at {type.FullName}.{property.Name}"); var propertyInfoField = property.CachePropertyInfo(); var attributeField = CacheAttributeInstance(property, propertyInfoField, extensionPoint); var method = property.GetMethod; var proceedReference = ImplementProceedGet(method, extensionPoint.AttributeType); // Re-implement method method.Body.Emit(il => { ImplementGetBody(attributeField, propertyInfoField, method, il, proceedReference); }); }
public void Weave(PropertyDefinition property, ExtensionPointAttribute extensionPoint) { // if (property.DeclaringType != interceptor.DeclaringType) // Debugger.Launch(); var type = property.DeclaringType; LogInfo($"Weaving property interceptor {extensionPoint.AttributeType.FullName} at {type.FullName}.{property.Name}"); var propertyInfoField = property.CachePropertyInfo(); var attributeField = CacheAttributeInstance(property, propertyInfoField, extensionPoint); LogInfo("Setter is intercepted"); var method = property.SetMethod; var proceedReference = ImplementProceedSet(method, extensionPoint.AttributeType); // Re-implement method method.Body.Emit(il => { ImplementSetBody(property, attributeField, propertyInfoField, method, il, proceedReference); }); }