Skip to content

Instantly share code, notes, and snippets.

@hishaamn
Created April 13, 2023 12:59
Show Gist options
  • Select an option

  • Save hishaamn/bf8f148814312d9b73f70413b146b71d to your computer and use it in GitHub Desktop.

Select an option

Save hishaamn/bf8f148814312d9b73f70413b146b71d to your computer and use it in GitHub Desktop.
public class ItemPackageEvent
{
public void OnPackageInstallItemsEndHandler(object sender, EventArgs e)
{
if (e == null)
{
return;
}
SitecoreEventArgs sitecoreEventArgs = e as SitecoreEventArgs;
if (sitecoreEventArgs == null || sitecoreEventArgs.Parameters == null || sitecoreEventArgs.Parameters.Length != 1)
{
return;
}
InstallationEventArgs parameter = sitecoreEventArgs.Parameters[0] as InstallationEventArgs;
// The paramter.ItemsToInstall provides the list of items together with the item id, language that have been installed on the CMS
// Check for null in case no item is available.
if (parameter == null || parameter.ItemsToInstall == null)
{
return;
}
// Implementation goes here for processing the list of items
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment