void Restore(PackageRestorer restorer, Action afterRestore)
{
ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesBeforeUpdateMessage();
PackageManagementBackgroundDispatcher.Dispatch(() => {
restorer.Restore(progressMessage);
if (!restorer.RestoreFailed)
{
afterRestore();
}
});
}