diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index 197b6bb96b..aac58453ce 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -1263,7 +1263,7 @@ namespace BizHawk.Client.EmuHawk DirectoryInfo dInfo = new DirectoryInfo(path); Type[] assemblyTypes; Assembly externalToolFile; - foreach (FileInfo fi in dInfo.GetFiles("*.dll")) + foreach (FileInfo fi in dInfo.GetFiles("*.dll")) { try { @@ -1279,7 +1279,7 @@ namespace BizHawk.Client.EmuHawk } ToolStripMenuItem externalToolMenu = new ToolStripMenuItem(externalToolFile.GetName().Name); - + /* The reason of using this ugly try catch is due to the use of ReflectionOnlyLoadFrom methods When the assembly is loaded this way, referenced assemblies are not loaded and so, as soon as a type @@ -1311,8 +1311,8 @@ namespace BizHawk.Client.EmuHawk externalToolMenu.ForeColor = Color.Gray; } externalToolToolStripMenuItem.DropDownItems.Add(externalToolMenu); - } - } + } + } if (externalToolToolStripMenuItem.DropDownItems.Count == 0) { externalToolToolStripMenuItem.DropDownItems.Add("None"); diff --git a/BizHawk.Client.EmuHawk/tools/ToolManager.cs b/BizHawk.Client.EmuHawk/tools/ToolManager.cs index 7e377033c4..4e0965708c 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolManager.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolManager.cs @@ -536,7 +536,7 @@ namespace BizHawk.Client.EmuHawk { _tools.ForEach(x => x.Close()); _tools.Clear(); - } + } /// /// Create a new instance of an IToolForm and return it @@ -548,8 +548,8 @@ namespace BizHawk.Client.EmuHawk where T : IToolForm { return CreateInstance(typeof(T), dllPath); - } - + } + /// /// Create a new instance of an IToolForm and return it /// @@ -568,13 +568,13 @@ namespace BizHawk.Client.EmuHawk , "Confirmm loading", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try - { + { tool = Activator.CreateInstanceFrom(dllPath, "BizHawk.Client.EmuHawk.CustomMainForm").Unwrap() as IExternalToolForm; if (tool == null) { MessageBox.Show("It seems that the object CustomMainForm does not implement IExternalToolForm. Please review the code.", "No, no, no. Wrong Way !", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return null; - } + } } catch (MissingMethodException) {