Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 1060a60

Browse files
committed
Adds some handlers and project creation state toggles in ProjectOperations
Fixes VSTS #984930 - Get to code can be re-entered during new project flow
1 parent 392e5dc commit 1060a60

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ public partial class ProjectOperations: Service
6969
RootWorkspace workspace;
7070

7171
SelectReferenceDialog selDialog = null;
72-
72+
73+
public event EventHandler BeforeCreateNewSolution;
74+
public event EventHandler AfterCreateNewSolution;
75+
public bool IsCreatingNewSolution { get; private set; }
76+
7377
internal ProjectOperations ()
7478
{
7579
}
@@ -749,8 +753,17 @@ public async Task<bool> NewSolution (string defaultTemplate, bool showTemplateSe
749753
newProjectDialog.ShowTemplateSelection = showTemplateSelection;
750754
var show = newProjectDialog.Show ();
751755
if (show) {
752-
WelcomePage.WelcomePageService.HideWelcomePageOrWindow ();
753-
return await newProjectDialog.ProjectCreation;
756+
try {
757+
IsCreatingNewSolution = true;
758+
BeforeCreateNewSolution?.Invoke (this, EventArgs.Empty);
759+
760+
WelcomePage.WelcomePageService.HideWelcomePageOrWindow ();
761+
var isProjectCreated = await newProjectDialog.ProjectCreation;
762+
return isProjectCreated;
763+
} finally {
764+
IsCreatingNewSolution = false;
765+
AfterCreateNewSolution?.Invoke (this, EventArgs.Empty);
766+
}
754767
}
755768
return false;
756769
}

0 commit comments

Comments
 (0)