(AddSelectionExec): wrapped method body into try/catch block.

This commit is contained in:
morkt 2015-08-11 07:09:21 +04:00
parent 9cdb4f0efe
commit 2f2bbb3dc0

View File

@ -1061,14 +1061,16 @@ namespace GARbro.GUI
/// </summary>
void AddSelectionExec (object sender, ExecutedRoutedEventArgs e)
{
var mask_list = new SortedSet<string>();
try
{
var ext_list = new SortedSet<string>();
foreach (var entry in ViewModel)
{
var ext = Path.GetExtension (entry.Name).ToLowerInvariant();
if (!string.IsNullOrEmpty (ext))
mask_list.Add ("*" + ext);
ext_list.Add (ext);
}
var selection = new EnterMaskDialog (mask_list);
var selection = new EnterMaskDialog (ext_list.Select (ext => "*"+ext));
selection.Owner = this;
var result = selection.ShowDialog();
if (!result.Value)
@ -1098,6 +1100,11 @@ namespace GARbro.GUI
if (count != 0)
SetStatusText (Localization.Format ("MsgSelectedFiles", count));
}
catch (Exception X)
{
SetStatusText (X.Message);
}
}
void SelectAllExec (object sender, ExecutedRoutedEventArgs e)
{