|
|
|
@ -2,6 +2,7 @@
@@ -2,6 +2,7 @@
|
|
|
|
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using System.Windows.Threading; |
|
|
|
|
using ICSharpCode.SharpDevelop.Gui; |
|
|
|
|
|
|
|
|
|
namespace ICSharpCode.PackageManagement.Scripting |
|
|
|
@ -24,9 +25,32 @@ namespace ICSharpCode.PackageManagement.Scripting
@@ -24,9 +25,32 @@ namespace ICSharpCode.PackageManagement.Scripting
|
|
|
|
|
public override void Dispose() |
|
|
|
|
{ |
|
|
|
|
if (viewModel != null) { |
|
|
|
|
viewModel.ShutdownConsole(); |
|
|
|
|
DoEvents(); |
|
|
|
|
viewModel.Dispose(); |
|
|
|
|
viewModel = null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Allow package management console thread to finish. Can be busy if solution was open when the user
|
|
|
|
|
/// closed SharpDevelop.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void DoEvents() |
|
|
|
|
{ |
|
|
|
|
DispatcherFrame frame = new DispatcherFrame(); |
|
|
|
|
Dispatcher.CurrentDispatcher.BeginInvoke( |
|
|
|
|
DispatcherPriority.Background, |
|
|
|
|
new DispatcherOperationCallback(ExitFrame), |
|
|
|
|
frame); |
|
|
|
|
Dispatcher.PushFrame(frame); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
object ExitFrame(object frame) |
|
|
|
|
{ |
|
|
|
|
var dispatcherFrame = frame as DispatcherFrame; |
|
|
|
|
dispatcherFrame.Continue = false; |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|