Ejemplo n.º 1
0
 void Preserve(TypeDefinition marker, TypeDefinition implementation)
 {
     foreach (var constructor in implementation.GetConstructors())
     {
         annotations.AddPreservedMethod(marker, constructor);
     }
 }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
 void Preserve(TypeDefinition marker, TypeDefinition implementation)
 {
     if (marker == null || implementation == null)
     {
         return;
     }
     foreach (var constructor in implementation.GetConstructors())
     {
         annotations.AddPreservedMethod(marker, constructor);
     }
 }