void ProcessChildNode(TypeNode node, EventInvokerMethod eventInvoker) { var childEventInvoker = FindEventInvokerMethod(node.TypeDefinition); if (childEventInvoker == null) { if (node.TypeDefinition.BaseType.IsGenericInstance) { var methodReference = MakeGeneric(node.TypeDefinition.BaseType, eventInvoker.MethodReference); eventInvoker = new EventInvokerMethod { InvokerType = eventInvoker.InvokerType, MethodReference = methodReference, IsVisibleFromChildren = eventInvoker.IsVisibleFromChildren }; } } else { eventInvoker = childEventInvoker; } if (!eventInvoker.IsVisibleFromChildren) { var error = $"Cannot use '{eventInvoker.MethodReference.FullName}' in '{node.TypeDefinition.FullName}' since that method is not visible from the child class."; throw new WeavingException(error); } node.EventInvoker = eventInvoker; foreach (var childNode in node.Nodes) { ProcessChildNode(childNode, eventInvoker); } }
void ProcessChildNode(TypeNode node, EventInvokerMethod eventInvoker) { var childEventInvoker = FindEventInvokerMethod(node.TypeDefinition); if (childEventInvoker == null) { if (node.TypeDefinition.BaseType.IsGenericInstance) { var methodReference = MethodGenerifier.MakeGeneric(node.TypeDefinition.BaseType, eventInvoker.MethodReference); eventInvoker = new EventInvokerMethod { IsBeforeAfter = eventInvoker.IsBeforeAfter, MethodReference = methodReference, }; } } else { eventInvoker = childEventInvoker; } node.EventInvoker = eventInvoker; foreach (var childNode in node.Nodes) { ProcessChildNode(childNode, eventInvoker); } }
void ProcessChildNode(TypeNode node, EventInvokerMethod eventInvoker) { var childEventInvoker = FindEventInvokerMethod(node.TypeDefinition); if (childEventInvoker == null) { if (node.TypeDefinition.BaseType.IsGenericInstance) { var methodReference = MakeGeneric(node.TypeDefinition.BaseType, eventInvoker.MethodReference); eventInvoker = new EventInvokerMethod { InvokerType = eventInvoker.InvokerType, MethodReference = methodReference, }; } } else { eventInvoker = childEventInvoker; } node.EventInvoker = eventInvoker; foreach (var childNode in node.Nodes) { ProcessChildNode(childNode, eventInvoker); } }