diff options
author | Mike Krüger <mikkrg@microsoft.com> | 2018-04-16 17:30:27 +0300 |
---|---|---|
committer | Marius Ungureanu <teromario@yahoo.com> | 2018-04-17 19:57:35 +0300 |
commit | 671999f9cb25531a0420cc5898c28d91c0a0d413 (patch) | |
tree | 622cd6f01845aad2f9ef14d05cbf6052448ee9f0 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs | |
parent | 0a9d5590b5e68857ef98b96b3b70ca69c01cbd9b (diff) |
Fixes VSTS 591324: Multiple Popup save dialog when close using
keyboard shortcut multiple times
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/591324
This method isn't called anywhere else.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs index 6e28dc5616..4e9b56c683 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs @@ -148,15 +148,22 @@ namespace MonoDevelop.Ide.Commands // MonoDevelop.Ide.Commands.FileCommands.CloseAllFiles public class CloseAllFilesHandler : CommandHandler { - protected override void Run () + static bool isRunning; + + protected override async void Run () { - IdeApp.Workbench.CloseAllDocuments (false); + try { + isRunning = true; + await IdeApp.Workbench.CloseAllDocumentsAsync (false); + } finally { + isRunning = false; + } } protected override void Update (CommandInfo info) { // No point in closing all when there are no documents open - info.Enabled = IdeApp.Workbench.Documents.Count != 0; + info.Enabled = !isRunning && IdeApp.Workbench.Documents.Count != 0; } } |