Mud Designer HUB:

* Removed old code sending arguments to the editor applications when they start.
 * Re-organized the HUB code. ExecuteApp method is below all of the Controls code.
 * Added exception handling within the ExecuteApp Try/Catch/Finally code block.
This commit is contained in:
Scionwest_cp 2009-11-06 22:47:01 -08:00
parent 272e752bb7
commit 03340af1ff

View file

@ -27,6 +27,11 @@ namespace MudDesigner
ExecuteApp("Project Manager.exe"); ExecuteApp("Project Manager.exe");
} }
private void btnCurrencyEditor_Click(object sender, EventArgs e)
{
ExecuteApp("Currency Editor.exe");
}
private void ExecuteApp(string appName) private void ExecuteApp(string appName)
{ {
System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.Process process = new System.Diagnostics.Process();
@ -64,12 +69,6 @@ namespace MudDesigner
info.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal; info.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
info.WorkingDirectory = Application.StartupPath; info.WorkingDirectory = Application.StartupPath;
//If running in debug mode we dont want the apps saving stuff outside of its debug folder
#if DEBUG
info.Arguments = "";
#else
info.Arguments = Application.StartupPath + "\Data\";
#endif
process.StartInfo = info; process.StartInfo = info;
try try
{ {
@ -77,17 +76,15 @@ namespace MudDesigner
this.Hide(); this.Hide();
process.WaitForExit(); process.WaitForExit();
} }
catch { } catch(Exception ex)
{
MessageBox.Show("ERROR:\n" + ex.Message, "Editor HUB", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally finally
{ {
process = null; process = null;
this.Show(); this.Show();
} }
} }
private void btnCurrencyEditor_Click(object sender, EventArgs e)
{
ExecuteApp("Currency Editor.exe");
}
} }
} }