Browse Source

possible workaround to SD2-941.

i couldn't reproduce the problem illustrated in SD2-941, but instead this addresses the crash when BooBinding tries to reference FormsDesigner if the FormsDesigner.addin file does not exist.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1593 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Alpert 19 years ago
parent
commit
0fccdb3d58
  1. 8
      src/Main/Core/Project/Src/Services/MessageService/MessageService.cs

8
src/Main/Core/Project/Src/Services/MessageService/MessageService.cs

@ -81,6 +81,13 @@ namespace ICSharpCode.Core @@ -81,6 +81,13 @@ namespace ICSharpCode.Core
msg += "Exception occurred: " + ex.ToString();
}
if (MessageService.MainForm == null) {
// let's try this; don't know if it's threadsafe? I expect
// that MainForm.InvokeRequired can be assumed to be false
// if MainForm doesn't exist yet...
MessageBox.Show(StringParser.Parse(msg), StringParser.Parse("SharpDevelop: ${res:Global.ErrorText}"), MessageBoxButtons.OK, MessageBoxIcon.Error);
} else {
MethodInvoker showError = delegate {
MessageBox.Show(MessageService.MainForm, StringParser.Parse(msg), StringParser.Parse("${res:Global.ErrorText}"), MessageBoxButtons.OK, MessageBoxIcon.Error);
};
@ -89,6 +96,7 @@ namespace ICSharpCode.Core @@ -89,6 +96,7 @@ namespace ICSharpCode.Core
} else {
showError();
}
}
}
public static void ShowWarning(string message)

Loading…
Cancel
Save