Browse Source

Allow startup to continue if some commands fail

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3681 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
f26ce60c82
  1. 6
      src/Main/Base/Project/Src/Commands/AutostartCommands.cs
  2. 7
      src/Main/Core/Project/Src/AddInTree/CoreStartup.cs

6
src/Main/Base/Project/Src/Commands/AutostartCommands.cs

@ -112,7 +112,11 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -112,7 +112,11 @@ namespace ICSharpCode.SharpDevelop.Commands
if (!didLoadSolutionOrFile) {
foreach (ICommand command in AddInTree.BuildItems<ICommand>("/Workspace/AutostartNothingLoaded", null, false)) {
command.Run();
try {
command.Run();
} catch (Exception ex) {
MessageService.ShowError(ex);
}
}
}

7
src/Main/Core/Project/Src/AddInTree/CoreStartup.cs

@ -183,7 +183,12 @@ namespace ICSharpCode.Core @@ -183,7 +183,12 @@ namespace ICSharpCode.Core
// run workspace autostart commands
LoggingService.Info("Running autostart commands...");
foreach (ICommand command in AddInTree.BuildItems<ICommand>("/Workspace/Autostart", null, false)) {
command.Run();
try {
command.Run();
} catch (Exception ex) {
// allow startup to continue if some commands fail
MessageService.ShowError(ex);
}
}
}

Loading…
Cancel
Save