Ejemplo n.º 1
0
        ///// <summary>
        ///// Example shipment shipped / delivered notification handler
        ///// </summary>
        ///// <param name="sender">
        ///// The sender.
        ///// </param>
        ///// <param name="e">
        ///// The <see cref="StatusChangeEventArgs{IShipment}"/>
        ///// </param>
        //private void ShipmentServiceStatusChanged(IShipmentService sender, StatusChangeEventArgs<IShipment> e)
        //{
        //    var validKeys = new[]
        //                    {
        //                        Core.Constants.DefaultKeys.ShipmentStatus.Delivered,
        //                        Core.Constants.DefaultKeys.ShipmentStatus.Shipped
        //                    };

        //    foreach (var shipment in e.StatusChangedEntities)
        //    {
        //        if (!validKeys.Contains(shipment.ShipmentStatus.Key)) continue;

        //        LogHelper.Info<UmbracoEventHandler>(string.Format("Raising notification trigger for shippment no. {0}", shipment.ShipmentNumber));

        //        Notification.Trigger("OrderShipped", shipment, Core.Observation.Topic.Notifications);
        //    }
        //}


        //// Event handler methods

        /// <summary>
        /// Handles the <see cref="ProductContentFactory"/> on initializing event.
        /// </summary>
        /// <param name="sender">
        /// The <see cref="ProductContentFactory"/>.
        /// </param>
        /// <param name="e">
        /// The <see cref="VirtualContentEventArgs"/>.
        /// </param>
        /// <remarks>
        /// This is required to set the parent id of the virtual content
        /// </remarks>
        private static void ProductContentFactoryOnInitializing(ProductContentFactory sender, VirtualContentEventArgs e)
        {
            var store = ExampleUiHelper.Content.GetStoreRoot();

            e.Parent = store;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets the parent of Merchello virtual product content to the Home node.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private static void ProductContentFactoryOnInitializing(ProductContentFactory sender, VirtualContentEventArgs e)
 {
     e.Parent = ContentResolver.Instance.GetRootContent();
 }