Adds ImportPackageNotification/Event

This commit is contained in:
Warren Buckley
2021-03-17 09:51:43 +00:00
parent b60c0377fb
commit 1b12e368b2
2 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
using Umbraco.Cms.Core.Models.Packaging;
using Umbraco.Cms.Core.Packaging;
namespace Umbraco.Cms.Core.Events
{
public class ImportPackageNotification : ICancelableNotification
{
public ImportPackageNotification(InstallationSummary installationSummary, IPackageInfo packageMetaData)
{
InstallationSummary = installationSummary;
PackageMetaData = packageMetaData;
}
public IPackageInfo PackageMetaData { get; }
public InstallationSummary InstallationSummary { get; }
public bool Cancel { get; set; }
}
}

View File

@@ -129,7 +129,8 @@ namespace Umbraco.Cms.Core.Services.Implement
_auditService.Add(AuditType.PackagerInstall, userId, -1, "Package", $"Package data installed for package '{compiledPackage.Name}'.");
ImportedPackage.RaiseEvent(new ImportPackageEventArgs<InstallationSummary>(summary, compiledPackage, false), this);
// trigger the ImportPackage event
_eventAggregator.Publish(new ImportPackageNotification(summary, compiledPackage));
return summary;
}