void Preserve(TypeDefinition marker, TypeDefinition implementation) { foreach (var constructor in implementation.GetConstructors()) { annotations.AddPreservedMethod(marker, constructor); } }
private void MapInterfaceMethodsInTypeHierarchy(TypeDefinition type) { if (!type.HasInterfaces) { return; } foreach (TypeReference @interface in type.Interfaces) { TypeDefinition iface = @interface.Resolve(); if (iface == null || !iface.HasMethods) { continue; } foreach (MethodDefinition method in iface.Methods) { if (TryMatchMethod(type, method) != null) { continue; } MethodDefinition @base = GetBaseMethodInTypeHierarchy(type, method); if (@base == null) { continue; } Annotations.AddPreservedMethod(type, @base); } } }
void Preserve(TypeDefinition marker, TypeDefinition implementation) { if (marker == null || implementation == null) { return; } foreach (var constructor in implementation.GetConstructors()) { annotations.AddPreservedMethod(marker, constructor); } }