Browse Source

Form designer disposes the design surface without using BeginInvoke if the FormDesignerViewContent is being disposed.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@773 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 20 years ago
parent
commit
e3af292c9d
  1. 8
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/FormDesignerViewContent.cs

8
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/FormDesignerViewContent.cs

@ -55,6 +55,7 @@ namespace ICSharpCode.FormDesigner @@ -55,6 +55,7 @@ namespace ICSharpCode.FormDesigner
Panel p = new Panel();
DesignSurface designSurface;
bool disposing;
IDesignerLoaderProvider loaderProvider;
IDesignerGenerator generator;
@ -159,7 +160,11 @@ namespace ICSharpCode.FormDesigner @@ -159,7 +160,11 @@ namespace ICSharpCode.FormDesigner
// in the PropertyPad, "InvalidOperationException: The container cannot be disposed
// at design time" is thrown.
// This is solved by calling dispose after the double-click event has been processed.
p.BeginInvoke(new MethodInvoker(designSurface.Dispose));
if (disposing) {
designSurface.Dispose();
} else {
p.BeginInvoke(new MethodInvoker(designSurface.Dispose));
}
designSurface = null;
}
@ -269,6 +274,7 @@ namespace ICSharpCode.FormDesigner @@ -269,6 +274,7 @@ namespace ICSharpCode.FormDesigner
public override void Dispose()
{
disposing = true;
if (IsFormDesignerVisible) {
Deselected();
}

Loading…
Cancel
Save