コード例 #1
0
        /// <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();
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
 /// <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);
         }
     }
 }
コード例 #4
0
 private void DocumentPublished(IPublishingStrategy sender, PublishEventArgs <IContent> e)
 {
     DependencyProxy.CallDependencies(BaseUmbracoDependency.DependencyTypesEnum.Content, e.PublishedEntities.Cast <IContentBase>().ToList());
 }
コード例 #5
0
 private void DocumentMoved(IContentService sender, MoveEventArgs <IContent> e)
 {
     DependencyProxy.CallDependencies(BaseUmbracoDependency.DependencyTypesEnum.Content, e.MoveInfoCollection.Select(x => x.Entity).Cast <IContentBase>().ToList());
 }
コード例 #6
0
 void ContentService_Deleted(IContentService sender, DeleteEventArgs <IContent> e)
 {
     DependencyProxy.CallDependencies(BaseUmbracoDependency.DependencyTypesEnum.Content, e.DeletedEntities.Cast <IContentBase>().ToList());
 }
コード例 #7
0
 void MediaService_Moved(IMediaService sender, MoveEventArgs <IMedia> e)
 {
     DependencyProxy.CallDependencies(BaseUmbracoDependency.DependencyTypesEnum.Media, e.MoveInfoCollection.Select(x => x.Entity).Cast <IContentBase>().ToList());
 }
コード例 #8
0
 void MediaService_Saved(IMediaService sender, SaveEventArgs <IMedia> e)
 {
     DependencyProxy.CallDependencies(BaseUmbracoDependency.DependencyTypesEnum.Media, e.SavedEntities.Cast <IContentBase>().ToList());
 }