diff options
author | Aaron Bockover <abock@microsoft.com> | 2019-06-13 23:06:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-13 23:06:55 +0300 |
commit | 533e68ef6c4aba0672fb76309e2c3d0f4742aa0c (patch) | |
tree | cc299b038ad36f5d189ee623fd2c630557d2d596 /main/src/addins/MonoDevelop.Refactoring | |
parent | 56232b984df8cbb5b22bc233295410864262b774 (diff) | |
parent | a4d7d0189f29722f0c411cc6270ae59647c740c6 (diff) |
Merge pull request #7850 from mono/pr-anvod-extract-interface
Fixes VSTS 893547: Extract Interface Dialog buttons don't close dialog
Diffstat (limited to 'main/src/addins/MonoDevelop.Refactoring')
-rw-r--r-- | main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.ExtractInterface/ExtractInterfaceOptionService.cs | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.ExtractInterface/ExtractInterfaceOptionService.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.ExtractInterface/ExtractInterfaceOptionService.cs index c12bf94ebe..0a6af9bb24 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.ExtractInterface/ExtractInterfaceOptionService.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.ExtractInterface/ExtractInterfaceOptionService.cs @@ -59,31 +59,32 @@ namespace MonoDevelop.Refactoring.ExtractInterface { await threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync (); - var dialog = new ExtractInterfaceDialog (); + using (var dialog = new ExtractInterfaceDialog ()) { - dialog.Init ( - syntaxFactsService, - notificationService, - extractableMembers, - defaultInterfaceName, - conflictingTypeNames, - defaultNamespace, - generatedNameTypeParameterSuffix, - languageName); + dialog.Init ( + syntaxFactsService, + notificationService, + extractableMembers, + defaultInterfaceName, + conflictingTypeNames, + defaultNamespace, + generatedNameTypeParameterSuffix, + languageName); - bool performChange = dialog.Run () == Xwt.Command.Ok; - if (!performChange) - return ExtractInterfaceOptionsResult.Cancelled; + bool performChange = dialog.Run () == Xwt.Command.Ok; + if (!performChange) + return ExtractInterfaceOptionsResult.Cancelled; - return new ExtractInterfaceOptionsResult ( - false, - dialog.IncludedMembers.AsImmutable (), - dialog.InterfaceName, - dialog.FileName, - dialog.UseSameFile - ? ExtractInterfaceOptionsResult.ExtractLocation.SameFile - : ExtractInterfaceOptionsResult.ExtractLocation.NewFile - ); + return new ExtractInterfaceOptionsResult ( + false, + dialog.IncludedMembers.AsImmutable (), + dialog.InterfaceName, + dialog.FileName, + dialog.UseSameFile + ? ExtractInterfaceOptionsResult.ExtractLocation.SameFile + : ExtractInterfaceOptionsResult.ExtractLocation.NewFile + ); + } } } } |