Browse Source

Handle NotSupportedException on invalid icon format

pull/30/head
Daniel Grunwald 13 years ago
parent
commit
6f61f7981d
  1. 7
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ApplicationSettings.xaml.cs

7
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ApplicationSettings.xaml.cs

@ -14,6 +14,7 @@ using System.Windows; @@ -14,6 +14,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Editor;
@ -240,11 +241,15 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -240,11 +241,15 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
image.Source = src;
image.Stretch = Stretch.Uniform;
Image = image.Source;
} catch (OutOfMemoryException) {
Image = null;
MessageService.ShowErrorFormatted("${res:Dialog.ProjectOptions.ApplicationSettings.InvalidIconFile}",
FileUtility.NormalizePath(appIconPath));
} catch (NotSupportedException) {
Image = null;
MessageService.ShowErrorFormatted("${res:Dialog.ProjectOptions.ApplicationSettings.InvalidIconFile}",
FileUtility.NormalizePath(appIconPath));
}
} else {
Image = null;

Loading…
Cancel
Save