diff --git a/RecodeItGUI/GUI/Main.cs b/RecodeItGUI/GUI/Main.cs index 9157ac0..b0a32dc 100644 --- a/RecodeItGUI/GUI/Main.cs +++ b/RecodeItGUI/GUI/Main.cs @@ -842,7 +842,7 @@ public partial class ReCodeItForm : Form if (result != string.Empty) { AppSettings.AutoMapper.AssemblyPath = result; - TargetAssemblyPath.Text = result; + AutoMapperTargetPath.Text = result; } } @@ -853,7 +853,7 @@ public partial class ReCodeItForm : Form if (result != string.Empty) { AppSettings.AutoMapper.OutputPath = result; - RemapperOutputDirectoryPath.Text = result; + AutoMapperOuputPath.Text = result; } } diff --git a/RecodeItLib/AutoMapper/ReCodeItAutoMapper.cs b/RecodeItLib/AutoMapper/ReCodeItAutoMapper.cs index 65fa2a0..ea96167 100644 --- a/RecodeItLib/AutoMapper/ReCodeItAutoMapper.cs +++ b/RecodeItLib/AutoMapper/ReCodeItAutoMapper.cs @@ -46,12 +46,11 @@ public class ReCodeItAutoMapper TotalPropertyRenameCount = 0; var types = Module.GetTypes(); + AllTypes.AddRange(types); FindCompilerGeneratedObjects(types); - GetAllTypes(types); - - Logger.Log($"Found {CompilerGeneratedClasses.Count - AllTypes.Count} potential remappable types"); + Logger.Log($"Found {AllTypes.Count - CompilerGeneratedClasses.Count} potential remappable types"); Logger.Log($"Found {CompilerGeneratedClasses.Count} compiler generated objects"); foreach (var type in types) @@ -78,19 +77,6 @@ public class ReCodeItAutoMapper WriteChanges(); } - private void GetAllTypes(IEnumerable types) - { - AllTypes.AddRange(types); - - foreach (var type in types) - { - if (type.HasNestedTypes) - { - GetAllTypes(type.NestedTypes); - } - } - } - /// /// Finds any compiler generated code so we can ignore it, its mostly LINQ garbage /// @@ -154,6 +140,8 @@ public class ReCodeItAutoMapper //Logger.Log($"Paremeter Names: {string.Join(", ", parmNames)}"); //Logger.Log($"Paremeter Types: {string.Join(", ", parmTypes)}\n"); + if (parm.Type.TryGetTypeDef() is null) continue; + var mapPair = new MappingPair( parm.Type.TryGetTypeDef(), parm.Name,