Example #1
0
 public void ConvertNewToOverrides(ModuleDefinition module)
 {
     foreach (var type in module.GetTypes())
     {
         if (type.IsInterface)
         {
             continue;
         }
         if (type.IsEnum)
         {
             continue;
         }
         var baseTypes   = GetBaseTypes(type).ToList();
         var baseMethods = MethodCache.Where(x => baseTypes.Contains(x.DeclaringType)).ToList();
         if (baseMethods.Count == 0)
         {
             continue;
         }
         foreach (var methodDefinition in type.Methods)
         {
             Replace(methodDefinition, baseMethods);
         }
         foreach (var propertyDefinition in type.Properties)
         {
             Replace(propertyDefinition.GetMethod, baseMethods);
             Replace(propertyDefinition.SetMethod, baseMethods);
         }
     }
 }