Esempio n. 1
0
 void FilterEvent(IContentService sender, Umbraco.Core.Events.MoveEventArgs <IContent> e)
 {
     //check if this is a valid content type
     if (e.MoveInfoCollection.Select(c => c.Entity.ContentType.Alias).Intersect(ContentTypeAliases).Any())
     {
         MethodToBind.Invoke(null, new object[] { sender, e });
     }
 }
Esempio n. 2
0
 private void ContentService_Moved(Umbraco.Core.Services.IContentService sender,
                                   Umbraco.Core.Events.MoveEventArgs <Umbraco.Core.Models.IContent> e)
 {
     if (AllowProcessing)
     {
         Sync(e.MoveInfoCollection.Select(x => x.Entity.Key), e.MoveInfoCollection.Where(x => x.Entity.Published).Select(x => x.Entity));
     }
 }
Esempio n. 3
0
 private void ContentService_Trashed(IContentService sender, Umbraco.Core.Events.MoveEventArgs <IContent> e)
 {
     LogHelper.Info <ContentHandler>("Content Trashed:");
     foreach (var moveInfo in e.MoveInfoCollection)
     {
         uSyncIOHelper.ArchiveRelativeFile(SyncFolder, GetContentPath(moveInfo.Entity), "content");
     }
 }
Esempio n. 4
0
        public void MediaService_Moved(Umbraco.Core.Services.IMediaService sender, Umbraco.Core.Events.MoveEventArgs <Umbraco.Core.Models.IMedia> e)
        {
            foreach (var item in e.MoveInfoCollection.Select(mi => mi.Entity))
            {
                var properties = new PropertiesDictionary(item);

                AsyncUtil.RunSync(() => _messagingService.SendMessageAsync("mediaService", "moved", properties));
            }
        }
Esempio n. 5
0
        protected void ContentService_Trashed(IContentService sender, Umbraco.Core.Events.MoveEventArgs <IContent> e)
        {
            // Remove any cache associated to the modified content nodes
            Routing.Helpers.CacheHelper.Remove(string.Format(Routing.Constants.Cache.NodeDependencyCacheIdPattern, e.Entity.Id));
            new Controllers.PersistentCacheController().Remove(e.Entity.Id);

            // Remove all Ulrs cached for which no content node was found
            Routing.Helpers.CacheHelper.Remove(string.Format(Routing.Constants.Cache.NodeDependencyCacheIdPattern, 0));
            new Controllers.PersistentCacheController().Remove(0);
        }
Esempio n. 6
0
        private void MediaService_Trashing(IMediaService sender, Umbraco.Core.Events.MoveEventArgs <IMedia> e)
        {
            if (uSyncEvents.Paused)
            {
                return;
            }

            foreach (var moveInfo in e.MoveInfoCollection)
            {
                uSyncIOHelper.ArchiveRelativeFile(SyncFolder, GetMediaPath(moveInfo.Entity), "media");
            }
        }
Esempio n. 7
0
 void MediaService_Moved(IMediaService sender, Umbraco.Core.Events.MoveEventArgs <IMedia> e)
 {
     IndexMedia(e.Entity);
 }
Esempio n. 8
0
 void ContentService_Moved(IContentService sender, Umbraco.Core.Events.MoveEventArgs <IContent> e)
 {
     IndexContent(e.Entity);
 }
Esempio n. 9
0
 void MediaService_Trashed(IMediaService sender, Umbraco.Core.Events.MoveEventArgs <IMedia> e)
 {
     DeleteMedia(e.Entity);
 }
Esempio n. 10
0
 void ContentService_Trashed(IContentService sender, Umbraco.Core.Events.MoveEventArgs <IContent> e)
 {
     DeleteContent(e.Entity);
 }
Esempio n. 11
0
        // REMOVE!
        private void ContentService_Trashed(Umbraco.Core.Services.IContentService sender, Umbraco.Core.Events.MoveEventArgs <Umbraco.Core.Models.IContent> e)
        {
            var fileSystemService = new FileSystemService(new DirectoryInfo(HttpRuntime.AppDomainAppPath));
            var configProvider    = new DexterConfigProvider(fileSystemService);
            var indexService      = new IndexService(configProvider);

            foreach (var moveInfo in e.MoveInfoCollection)
            {
                indexService.Remove(moveInfo.Entity);
            }
        }