private void EvListener_Raised(object sender, EPiServer.Events.EventNotificationEventArgs e)
        {
            var eventArgs                 = (CatalogKeyEventArgs)DeSerialize((byte[])e.Param);
            var priceUpdatedEventArgs     = eventArgs as PriceUpdateEventArgs;
            var inventoryUpdatedEventArgs = eventArgs as InventoryUpdateEventArgs;
            var logger = LogManager.GetLogger();

            if (priceUpdatedEventArgs != null)
            {
                logger.Error($"the price was changed!");
            }
            if (inventoryUpdatedEventArgs != null)
            {
                logger.Error($"the inventory was changed!");
            }
        }
        private void EvKeyListener_Raised(object sender, EPiServer.Events.EventNotificationEventArgs e)
        {
            var eventArgs                 = (CatalogKeyEventArgs)DeSerialize((byte[])e.Param);
            var priceUpdatedEventArgs     = eventArgs as PriceUpdateEventArgs;
            var inventoryUpdatedEventArgs = eventArgs as InventoryUpdateEventArgs;
            var info = new List <string>();

            if (priceUpdatedEventArgs != null)
            {
                info.Add("The price was changed!");
            }
            if (inventoryUpdatedEventArgs != null)
            {
                info.Add("Inventory was changed!");
            }
            WriteToTextFile(info);
        }
        private void EvListner_Raised(object sender, EPiServer.Events.EventNotificationEventArgs e)
        {
            var eventArgs = (CatalogContentUpdateEventArgs)DeSerialize((byte[])e.Param);

            if (eventArgs.EventType == CatalogEventBroadcaster.CatalogEntryUpdatedEventType)
            {
                int entryId = eventArgs.CatalogEntryIds.First();
                ReferenceConverter refConvert = ServiceLocator.Current.GetInstance <ReferenceConverter>();
                ContentReference   catRef     = refConvert.GetEntryContentLink(entryId);
                IContentLoader     loader     = ServiceLocator.Current.GetInstance <IContentLoader>();
                var catEntry = loader.Get <IContent>(catRef);

                var info = new List <string>
                {
                    "Remote Catalog Event Fired!",
                    $"The name of the item updated: {catEntry.Name}"
                };
                WriteToTextFile(info);
            }
        }