/// <summary>
 /// Adds or updates a product variant to the index if the product variant has an identity
 /// </summary>
 static void ProductVariantServiceCreated(IProductVariantService sender, Core.Events.NewEventArgs <IProductVariant> e)
 {
     if (e.Entity.HasIdentity)
     {
         IndexProductVariant(e.Entity);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// When an entity is created new permissions may be assigned to it based on it's parent, if that is the
        /// case then we need to clear all user permissions cache.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        static void ContentServiceCreated(IContentService sender, Core.Events.NewEventArgs <IContent> e)
        {
            //check if permissions have changed
            var permissionsChanged = ((Content)e.Entity).WasPropertyDirty("PermissionsChanged");

            if (permissionsChanged)
            {
                DistributedCache.Instance.RefreshAllUserPermissionsCache();
            }
        }
Ejemplo n.º 3
0
        private void EntityCollectionServiceOnCreated(IEntityCollectionService sender, Core.Events.NewEventArgs <IEntityCollection> e)
        {
            if (!EntityCollectionProviderResolver.HasCurrent)
            {
                return;
            }

            EntityCollectionProviderResolver.Current.AddOrUpdateCache(e.Entity);
        }
 /// <summary>
 /// After a media has been created, auto-fill the properties.
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="args">The event arguments.</param>
 public void MediaServiceCreated(IMediaService sender, Core.Events.NewEventArgs <IMedia> args)
 {
     AutoFillProperties(args.Entity);
 }
Ejemplo n.º 5
0
 private void CustomerServiceCreated(ICustomerService sender, Core.Events.NewEventArgs <ICustomer> newEventArgs)
 {
     _customerIndexer.AddCustomerToIndex(newEventArgs.Entity);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// The customer service created.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="args">
 /// The args.
 /// </param>
 public void CustomerServiceCreated(ICustomerService sender, Core.Events.NewEventArgs <ICustomer> args)
 {
     IndexCustomer(args.Entity);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Clears the cache when a payment method is created
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="newEventArgs">
 /// The new event args.
 /// </param>
 private void BraintreePaymentMethodApiServiceOnCreated(BraintreePaymentMethodApiService sender, Core.Events.NewEventArgs <PaymentMethod> newEventArgs)
 {
     ClearBraintreeCache();
 }
Ejemplo n.º 8
0
 /// <summary>
 /// The braintree subscription api service on created.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="newEventArgs">
 /// The new event args.
 /// </param>
 private void BraintreeSubscriptionApiServiceOnCreated(BraintreeSubscriptionApiService sender, Core.Events.NewEventArgs <Subscription> newEventArgs)
 {
     ClearBraintreeCache();
 }
Ejemplo n.º 9
0
 static void MediaServiceCreated(IMediaService sender, Core.Events.NewEventArgs <IMedia> e)
 {
     AutoFillProperties(e.Entity);
 }
Ejemplo n.º 10
0
 static void MediaServiceCreated(IMediaService sender, Core.Events.NewEventArgs <IMedia> e)
 {
     IndexMedia(e.Entity);
 }
Ejemplo n.º 11
0
 static void ContentServiceCreated(IContentService sender, Core.Events.NewEventArgs <IContent> e)
 {
     IndexConent(e.Entity);
 }