parent
7d2e02b94b
commit
6f18e44fe7
|
@ -1263,7 +1263,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
DirectoryInfo dInfo = new DirectoryInfo(path);
|
DirectoryInfo dInfo = new DirectoryInfo(path);
|
||||||
Type[] assemblyTypes;
|
Type[] assemblyTypes;
|
||||||
Assembly externalToolFile;
|
Assembly externalToolFile;
|
||||||
foreach (FileInfo fi in dInfo.GetFiles("*.dll"))
|
foreach (FileInfo fi in dInfo.GetFiles("*.dll"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1279,7 +1279,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolStripMenuItem externalToolMenu = new ToolStripMenuItem(externalToolFile.GetName().Name);
|
ToolStripMenuItem externalToolMenu = new ToolStripMenuItem(externalToolFile.GetName().Name);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The reason of using this ugly try catch is due to the use of ReflectionOnlyLoadFrom methods
|
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
|
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;
|
externalToolMenu.ForeColor = Color.Gray;
|
||||||
}
|
}
|
||||||
externalToolToolStripMenuItem.DropDownItems.Add(externalToolMenu);
|
externalToolToolStripMenuItem.DropDownItems.Add(externalToolMenu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (externalToolToolStripMenuItem.DropDownItems.Count == 0)
|
if (externalToolToolStripMenuItem.DropDownItems.Count == 0)
|
||||||
{
|
{
|
||||||
externalToolToolStripMenuItem.DropDownItems.Add("None");
|
externalToolToolStripMenuItem.DropDownItems.Add("None");
|
||||||
|
|
|
@ -536,7 +536,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
_tools.ForEach(x => x.Close());
|
_tools.ForEach(x => x.Close());
|
||||||
_tools.Clear();
|
_tools.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new instance of an IToolForm and return it
|
/// Create a new instance of an IToolForm and return it
|
||||||
|
@ -548,8 +548,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
where T : IToolForm
|
where T : IToolForm
|
||||||
{
|
{
|
||||||
return CreateInstance(typeof(T), dllPath);
|
return CreateInstance(typeof(T), dllPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new instance of an IToolForm and return it
|
/// Create a new instance of an IToolForm and return it
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -568,13 +568,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
, "Confirmm loading", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
, "Confirmm loading", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
tool = Activator.CreateInstanceFrom(dllPath, "BizHawk.Client.EmuHawk.CustomMainForm").Unwrap() as IExternalToolForm;
|
tool = Activator.CreateInstanceFrom(dllPath, "BizHawk.Client.EmuHawk.CustomMainForm").Unwrap() as IExternalToolForm;
|
||||||
if (tool == null)
|
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);
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (MissingMethodException)
|
catch (MissingMethodException)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue