public void Execute(OnUpdatedArgs <MediaFile> args) { if (!args.Item.IsImage()) { return; } if (!args.HasChanged(file => file.Title) && !args.HasChanged(file => file.Description)) { return; } var prefix = string.Format("{0}{1}", MediaSettingExtensions.RenderImagePrefix, GetUrlWithoutExtension(args.Item.FileUrl)); _cacheManager.Clear(prefix); }
public void Execute(OnUpdatedArgs <MediaFile> args) { if (!args.Item.IsImage()) { return; } if (!args.HasChanged(file => file.Title) && !args.HasChanged(file => file.Description)) { return; } var tagPrefix = $"{MediaSettingExtensions.RenderTagPrefix}{GetUrlWithoutExtension(args.Item.FileUrl)}"; var urlPrefix = $"{MediaSettingExtensions.RenderUrlPrefix}{GetUrlWithoutExtension(args.Item.FileUrl)}"; _cacheManager.Clear(tagPrefix); _cacheManager.Clear(urlPrefix); }
public void Execute(OnUpdatedArgs <Webpage> args) { if (!args.HasChanged(x => x.CustomFooterScripts)) { return; } EventContext.Instance.Publish <IOnFooterScriptChanged, ScriptChangedEventArgs <Webpage> >( new ScriptChangedEventArgs <Webpage>(args.Item, args.Item.CustomFooterScripts, args.Original?.CustomFooterScripts)); }