static void ContentTypeService_SavedMediaType(Umbraco.Core.Services.IContentTypeService sender, Umbraco.Core.Events.SaveEventArgs <IMediaType> e) { LogHelper.Info <SyncMediaTypes>("MediaType Saved"); foreach (var item in e.SavedEntities) { SaveToDisk(item); } }
static void ContentTypeService_DeletedMediaType(Umbraco.Core.Services.IContentTypeService sender, Umbraco.Core.Events.DeleteEventArgs <IMediaType> e) { LogHelper.Info <SyncMediaTypes>("MediaType Deleted"); foreach (var item in e.DeletedEntities) { uSyncIO.ArchiveFile(GetMediaPath(item), item.Alias, "MediaType"); } }
public static void AddOrUpdateDocType(IContentType docType) { Umbraco.Core.Services.IContentTypeService contentTypeService = ApplicationContext.Current.Services.ContentTypeService; IContentType actualDocType = docType; IContentType oldContentType = contentTypeService.GetContentType(docType.Alias); actualDocType = oldContentType != null?oldContentType.OverrideWith(docType) : docType; actualDocType.UpdateDate = DateTime.Now; contentTypeService.Save(actualDocType); }
private void ContentTypeService_SavedContentType(Umbraco.Core.Services.IContentTypeService sender, Umbraco.Core.Events.SaveEventArgs <Umbraco.Core.Models.IContentType> e) { var entity = e.SavedEntities.FirstOrDefault(); SaveEntityChange(EntityType.CONTENT_TYPE, entity.Name); }