Browse Source

Fixed exception when deleting a file that had multiple view contents open in the same WorkbenchWindow (e.g. Source view+Designer view, or Source view+Subversion History).

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2693 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
c7918345e7
  1. 7
      src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs

7
src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs

@ -459,7 +459,12 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -459,7 +459,12 @@ namespace ICSharpCode.SharpDevelop.Gui
foreach (OpenedFile file in FileService.OpenedFiles) {
if (FileUtility.IsBaseDirectory(e.FileName, file.FileName)) {
foreach (IViewContent content in file.RegisteredViewContents.ToArray()) {
content.WorkbenchWindow.CloseWindow(true);
// content.WorkbenchWindow can be null if multiple view contents
// were in the same WorkbenchWindow and both should be closed
// (e.g. Windows Forms Designer, Subversion History View)
if (content.WorkbenchWindow != null) {
content.WorkbenchWindow.CloseWindow(true);
}
}
}
}

Loading…
Cancel
Save