catch exceptions during app command line parsing.

This commit is contained in:
morkt 2014-08-08 13:48:52 +04:00
parent b2d0e15215
commit 1e390eed1e

View File

@ -67,20 +67,20 @@ namespace GARbro.GUI
Trace.AutoFlush = true; Trace.AutoFlush = true;
#endif #endif
Trace.WriteLine ("ApplicationStartup --------------------------------", "GARbro.GUI.App"); Trace.WriteLine ("ApplicationStartup --------------------------------", "GARbro.GUI.App");
try
{
if (0 != e.Args.Length) if (0 != e.Args.Length)
{ {
InitPath = Path.GetFullPath (e.Args[0]); InitPath = Path.GetFullPath (e.Args[0]);
} }
else if (!string.IsNullOrEmpty (Settings.Default.appLastDirectory)) else if (!string.IsNullOrEmpty (Settings.Default.appLastDirectory))
{
try
{ {
string last_dir = Settings.Default.appLastDirectory; string last_dir = Settings.Default.appLastDirectory;
Directory.SetCurrentDirectory (last_dir); Directory.SetCurrentDirectory (last_dir);
InitPath = last_dir; InitPath = last_dir;
} }
catch { }
} }
catch { }
if (string.IsNullOrEmpty (InitPath)) if (string.IsNullOrEmpty (InitPath))
InitPath = Directory.GetCurrentDirectory(); InitPath = Directory.GetCurrentDirectory();