/// <summary> /// Class specific to .net cache providers, Cleans up our BaseUmbracoDependencys /// </summary> protected override void DependencyDispose() { LogHelper.Info <UmbracoDependency>("Cleaning up as dependency disposed called"); DependencyProxy.AddQueueItemsToBeRemoved(_myDependencies); base.DependencyDispose(); }
/// <summary> /// This is a .Net Cache dependency, It can be linked to multiple Umbraco Dependencies /// </summary> /// <param name="dependencies">List of Umbraco Dependencies for the Cache to be flushed on</param> public UmbracoDependency(params BaseUmbracoDependency[] dependencies) { LogHelper.Info <UmbracoDependency>("Initialized"); _myDependencies = dependencies; foreach (var umbracoDependency in _myDependencies) { LogHelper.Info <UmbracoDependency>("adding tie"); umbracoDependency.AddTieToDependency(this); } DependencyProxy.AddDependencies(dependencies); }
/// <summary> /// Loops through all the current umbraco dependencies and /// </summary> /// <param name="contentType"></param> /// <param name="contentItems"></param> internal static void CallDependencies(BaseUmbracoDependency.DependencyTypesEnum contentType, List <IContentBase> contentItems) { lock (CurrentDependencies) { LogHelper.Info(typeof(DependencyProxy), "Event Detected:" + contentType + " for ids:" + string.Join(",", contentItems.Select(x => x.Id))); foreach (BaseUmbracoDependency baseUmbracoDependency in CurrentDependencies) { baseUmbracoDependency.HandleEvent(contentType, contentItems); } lock (CurrentRemovalQueue) { DependencyProxy.RemoveUmbracoDependencies(CurrentRemovalQueue.ToArray()); CurrentRemovalQueue.RemoveAll(x => true); } } }
private void DocumentPublished(IPublishingStrategy sender, PublishEventArgs <IContent> e) { DependencyProxy.CallDependencies(BaseUmbracoDependency.DependencyTypesEnum.Content, e.PublishedEntities.Cast <IContentBase>().ToList()); }
private void DocumentMoved(IContentService sender, MoveEventArgs <IContent> e) { DependencyProxy.CallDependencies(BaseUmbracoDependency.DependencyTypesEnum.Content, e.MoveInfoCollection.Select(x => x.Entity).Cast <IContentBase>().ToList()); }
void ContentService_Deleted(IContentService sender, DeleteEventArgs <IContent> e) { DependencyProxy.CallDependencies(BaseUmbracoDependency.DependencyTypesEnum.Content, e.DeletedEntities.Cast <IContentBase>().ToList()); }
void MediaService_Moved(IMediaService sender, MoveEventArgs <IMedia> e) { DependencyProxy.CallDependencies(BaseUmbracoDependency.DependencyTypesEnum.Media, e.MoveInfoCollection.Select(x => x.Entity).Cast <IContentBase>().ToList()); }
void MediaService_Saved(IMediaService sender, SaveEventArgs <IMedia> e) { DependencyProxy.CallDependencies(BaseUmbracoDependency.DependencyTypesEnum.Media, e.SavedEntities.Cast <IContentBase>().ToList()); }