|
|
|
|
@ -161,7 +161,8 @@ namespace ICSharpCode.SharpDevelop
@@ -161,7 +161,8 @@ namespace ICSharpCode.SharpDevelop
|
|
|
|
|
/// <summary>Called by OpenedFile.UnregisterView to update the dictionary.</summary>
|
|
|
|
|
internal static void OpenedFileClosed(OpenedFile file) |
|
|
|
|
{ |
|
|
|
|
if (openedFileDict[file.FileName] != file) |
|
|
|
|
OpenedFile existing; |
|
|
|
|
if (openedFileDict.TryGetValue(file.FileName, out existing) && existing != file) |
|
|
|
|
throw new ArgumentException("file must be registered"); |
|
|
|
|
|
|
|
|
|
openedFileDict.Remove(file.FileName); |
|
|
|
|
@ -217,12 +218,15 @@ namespace ICSharpCode.SharpDevelop
@@ -217,12 +218,15 @@ namespace ICSharpCode.SharpDevelop
|
|
|
|
|
public void Invoke(string fileName) |
|
|
|
|
{ |
|
|
|
|
OpenedFile file = FileService.GetOrCreateOpenedFile(FileName.Create(fileName)); |
|
|
|
|
IViewContent newContent = binding.CreateContentForFile(file); |
|
|
|
|
if (newContent != null) { |
|
|
|
|
DisplayBindingService.AttachSubWindows(newContent, false); |
|
|
|
|
WorkbenchSingleton.Workbench.ShowView(newContent, switchToOpenedView); |
|
|
|
|
try { |
|
|
|
|
IViewContent newContent = binding.CreateContentForFile(file); |
|
|
|
|
if (newContent != null) { |
|
|
|
|
DisplayBindingService.AttachSubWindows(newContent, false); |
|
|
|
|
WorkbenchSingleton.Workbench.ShowView(newContent, switchToOpenedView); |
|
|
|
|
} |
|
|
|
|
} finally { |
|
|
|
|
file.CloseIfAllViewsClosed(); |
|
|
|
|
} |
|
|
|
|
file.CloseIfAllViewsClosed(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|