private void ContentService_DeletedBlueprint(IContentService sender, Umbraco.Core.Events.DeleteEventArgs <IContent> e) { if (e.DeletedEntities.Any(x => !x.Name.InvariantStartsWith("dtge temp"))) { EventDeletedItem(sender, e); } }
void ContentService_Deleted(IContentService sender, Umbraco.Core.Events.DeleteEventArgs <IContent> e) { foreach (var item in e.DeletedEntities.Where(x => x.ContentType.Alias == "Project")) { ExamineManager.Instance.IndexProviderCollection["projectIndexer"].DeleteFromIndex(item.Id.ToString()); } }
static void MediaServiceDeleted(IMediaService sender, Umbraco.Core.Events.DeleteEventArgs <IMedia> e) { e.DeletedEntities.ForEach( media => ExamineManager.Instance.DeleteFromIndex( media.Id.ToString(), ExamineManager.Instance.IndexProviderCollection.OfType <BaseUmbracoIndexer>().Where(x => x.EnableDefaultEventHandler))); }
void FilterEvent(IContentService sender, Umbraco.Core.Events.DeleteEventArgs <IContent> e) { //check if this is a valid content type if (e.DeletedEntities.Select(c => c.ContentType.Alias).Intersect(ContentTypeAliases).Any()) { MethodToBind.Invoke(null, new object[] { sender, e }); } }
private void ContentService_Deleted(Umbraco.Core.Services.IContentService sender, Umbraco.Core.Events.DeleteEventArgs <Umbraco.Core.Models.IContent> e) { if (AllowProcessing) { Sync(e.DeletedEntities.Select(x => x.Key), null); } }
static void MacroService_Deleted(Umbraco.Core.Services.IMacroService sender, Umbraco.Core.Events.DeleteEventArgs <IMacro> e) { LogHelper.Info <SyncMacros>("Macro Deleted"); foreach (var macro in e.DeletedEntities) { uSyncIO.ArchiveFile("macro", macro.Alias); } }
public void MediaService_Deleted(Umbraco.Core.Services.IMediaService sender, Umbraco.Core.Events.DeleteEventArgs <Umbraco.Core.Models.IMedia> e) { foreach (var item in e.DeletedEntities) { var properties = new PropertiesDictionary(item); AsyncUtil.RunSync(() => _messagingService.SendMessageAsync("mediaService", "deleted", properties)); } }
static void FileService_DeletedTemplate(IFileService sender, Umbraco.Core.Events.DeleteEventArgs <ITemplate> e) { if (!uSync.EventsPaused) { foreach (var item in e.DeletedEntities) { XmlDoc.ArchiveFile("Template", XmlDoc.ScrubFile(item.Alias)); } } }
static void DataTypeService_Deleted(IDataTypeService sender, Umbraco.Core.Events.DeleteEventArgs <IDataTypeDefinition> e) { if (!uSync.EventsPaused) { foreach (var item in e.DeletedEntities) { XmlDoc.ArchiveFile("DataTypeDefinition", XmlDoc.ScrubFile(item.Name)); } } }
static void MacroService_Deleted(IMacroService sender, Umbraco.Core.Events.DeleteEventArgs <IMacro> e) { if (!uSync.EventsPaused) { foreach (var macro in e.DeletedEntities) { XmlDoc.ArchiveFile("Macro", XmlDoc.ScrubFile(macro.Alias)); } } }
static void ContentTypeService_DeletingMediaType(IContentTypeService sender, Umbraco.Core.Events.DeleteEventArgs <Umbraco.Core.Models.IMediaType> e) { if (!uSync.EventsPaused) { LogHelper.Debug <SyncMediaTypes>("DeletingMediaType for {0} items", () => e.DeletedEntities.Count()); foreach (var mediaType in e.DeletedEntities) { helpers.XmlDoc.ArchiveFile("MediaType", GetMediaPath(new MediaType(mediaType.Id)), "def"); } } }
void ContentService_Deleted(IContentService sender, Umbraco.Core.Events.DeleteEventArgs <Umbraco.Core.Models.IContent> e) { var fs = new ForumService(ApplicationContext.Current.DatabaseContext); foreach (var ent in e.DeletedEntities.Where(x => x.ContentType.Alias == "Forum")) { var f = fs.GetById(ent.Id); if (f != null) { fs.Delete(f); } } }
static void MemberTypeService_Deleting(IMemberTypeService sender, Umbraco.Core.Events.DeleteEventArgs <Umbraco.Core.Models.IMemberType> e) { if (!uSync.EventsPaused) { LogHelper.Debug <SyncMediaTypes>("DeletingMemberType for {0} items", () => e.DeletedEntities.Count()); foreach (var memberType in e.DeletedEntities) { LogHelper.Debug <SyncMemberType>("Removing MemberType id: {0}", () => memberType.Id); var path = GetMemberPath(new MemberType(memberType.Id)); helpers.XmlDoc.ArchiveFile("MemberType", path, "def"); } } }
private void MemberTypeService_Deleted(IMemberTypeService sender, Umbraco.Core.Events.DeleteEventArgs <IMemberType> e) { if (uSyncEvents.Paused) { return; } foreach (var item in e.DeletedEntities) { LogHelper.Info <MediaTypeHandler>("Delete: Remove usync files for {0}", () => item.Name); uSyncIOHelper.ArchiveRelativeFile(SyncFolder, GetContentPath(item), "def"); uSyncBackOfficeContext.Instance.Tracker.AddAction(SyncActionType.Delete, item.Key, item.Alias, typeof(IMemberType)); } }
private void FileService_DeletedTemplate(IFileService sender, Umbraco.Core.Events.DeleteEventArgs <ITemplate> e) { if (uSyncEvents.Paused) { return; } foreach (var item in e.DeletedEntities) { LogHelper.Info <TemplateHandler>("Delete: Deleting uSync File for item: {0}", () => item.Name); uSyncIOHelper.ArchiveRelativeFile(SyncFolder, GetItemPath(item)); uSyncBackOfficeContext.Instance.Tracker.AddAction(SyncActionType.Delete, item.Alias, typeof(ITemplate)); } }
private void DataTypeService_Deleted(IDataTypeService sender, Umbraco.Core.Events.DeleteEventArgs <IDataTypeDefinition> e) { if (uSyncEvents.Paused) { return; } foreach (var item in e.DeletedEntities) { LogHelper.Info <DataTypeHandler>("Delete: Deleting uSync File for item: {0}", () => item.Name); uSyncIOHelper.ArchiveRelativeFile(SyncFolder, item.Name.ToSafeAlias()); uSyncBackOfficeContext.Instance.Tracker.AddAction(SyncActionType.Delete, item.Key, item.Name, typeof(IDataTypeDefinition)); } }
protected void ContentService_Deleted(IContentService sender, Umbraco.Core.Events.DeleteEventArgs <IContent> e) { // Remove any cache associated to the modified content nodes var persistentCacheController = new Controllers.PersistentCacheController(); foreach (var entity in e.DeletedEntities) { Routing.Helpers.CacheHelper.Remove(string.Format(Routing.Constants.Cache.NodeDependencyCacheIdPattern, entity.Id)); persistentCacheController.Remove(entity.Id); } // Remove all Ulrs cached for which no content node was found Routing.Helpers.CacheHelper.Remove(string.Format(Routing.Constants.Cache.NodeDependencyCacheIdPattern, 0)); persistentCacheController.Remove(0); }
// Events fires when deleting a node from the recycle bin private void ContentService_Deleted(IContentService sender, Umbraco.Core.Events.DeleteEventArgs <Umbraco.Core.Models.IContent> e) { Notely.Core.Services.ServiceContext Services = new Core.Services.ServiceContext(); foreach (var node in e.DeletedEntities) { var notes = Services.NoteService.GetAllByContent(node.Id); foreach (var note in notes) { // Delete comments Services.NoteCommentService.DeleteByNoteId(note.Id); // Delete note Services.NoteService.Delete(note.Id); } } }
private void RelationService_DeletedRelation(IRelationService sender, Umbraco.Core.Events.DeleteEventArgs <IRelation> e) { if (uSync8BackOffice.eventsPaused) { return; } var types = new List <int>(); foreach (var item in e.DeletedEntities) { if (!types.Contains(item.RelationTypeId)) { types.Add(item.RelationTypeId); } } UpdateRelationTypes(types); }
/// <summary> /// When a member is deleted we should remove the associated logins /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void MemberService_Deleted(IMemberService sender, Umbraco.Core.Events.DeleteEventArgs <Umbraco.Core.Models.IMember> e) { var userMgr = _owinContext.GetUserManager <UmbracoMembersUserManager <T> >(); if (userMgr != null) { foreach (var member in e.DeletedEntities) { //delete the member from identity (this will already be removed from the members table, but this will ensure that // the users' external logins are removed too. userMgr.DeleteAsync(new T() { Id = member.Id, Name = member.Name, UserName = member.Username, Email = member.Email }); } } }
public void UserService_DeletedUserGroup(Umbraco.Core.Services.IUserService sender, Umbraco.Core.Events.DeleteEventArgs <Umbraco.Core.Models.Membership.IUserGroup> e) { foreach (var item in e.DeletedEntities) { var properties = new PropertiesDictionary(item); AsyncUtil.RunSync(() => _messagingService.SendMessageAsync("userService", "deletedUserGroup", properties)); } }
static void DataTypeService_Deleted(Umbraco.Core.Services.IDataTypeService sender, Umbraco.Core.Events.DeleteEventArgs <IDataTypeDefinition> e) { LogHelper.Info <SyncDictionaryItems>("Dicitionary Item Deleted"); foreach (var item in e.DeletedEntities) { uSyncIO.ArchiveFile("DataTypeDefinition", item.Name); } }
private void ContentService_Deleted(Umbraco.Core.Services.IContentService sender, Umbraco.Core.Events.DeleteEventArgs <IContent> e) => RemoveIndexEntries(e.DeletedEntities);
private void LocalizationService_DeletedLanguage(ILocalizationService sender, Umbraco.Core.Events.DeleteEventArgs <ILanguage> e) { if (uSyncEvents.Paused) { return; } foreach (var item in e.DeletedEntities) { LogHelper.Info <MacroHandler>("Delete: Deleting uSync File for item: {0}", () => item.CultureName); uSyncIOHelper.ArchiveRelativeFile(SyncFolder, item.CultureName.ToSafeAlias()); uSyncBackOfficeContext.Instance.Tracker.AddAction(SyncActionType.Delete, item.CultureName, typeof(ILanguage)); } }
static void ContentTypeService_DeletingContentType(IContentTypeService sender, Umbraco.Core.Events.DeleteEventArgs <IContentType> e) { if (!uSync.EventsPaused) { LogHelper.Debug <SyncDocType>("Deleting Type Fired for {0} types", () => e.DeletedEntities.Count()); // delete things (there can sometimes be more than one??) foreach (var docType in e.DeletedEntities) { helpers.XmlDoc.ArchiveFile("DocumentType", docType.GetSyncPath(), "def"); } } }
private void MediaService_Deleted(Umbraco.Core.Services.IMediaService sender, Umbraco.Core.Events.DeleteEventArgs <Umbraco.Core.Models.IMedia> e) { var fileSystemService = new FileSystemService(new DirectoryInfo(HttpRuntime.AppDomainAppPath)); var configProvider = new DexterConfigProvider(fileSystemService); var indexService = new IndexService(configProvider); foreach (var entity in e.DeletedEntities) { indexService.Remove(entity); } }
static void ContentTypeService_DeletingContentType(IContentTypeService sender, Umbraco.Core.Events.DeleteEventArgs <IContentType> e) { LogHelper.Info <ContentType>("Content Type Deleted"); foreach (var doctype in e.DeletedEntities) { uSyncIO.ArchiveFile(ItemSavePath(doctype), "def", "DocumentType"); } }
public static void ClearCache(Umbraco.Core.Services.IMediaService sender, Umbraco.Core.Events.DeleteEventArgs <IMedia> e) { ClearMediaCache(); }
void MediaService_Deleted(IMediaService sender, Umbraco.Core.Events.DeleteEventArgs <IMedia> e) { e.DeletedEntities.ForEach(DeleteMedia); }
void ContentService_Deleted(IContentService sender, Umbraco.Core.Events.DeleteEventArgs <IContent> e) { e.DeletedEntities.ForEach(DeleteContent); }