Adds ImportPackageNotification/Event
This commit is contained in:
21
src/Umbraco.Core/Events/ImportPackageNotification.cs
Normal file
21
src/Umbraco.Core/Events/ImportPackageNotification.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user