2013-04-04 23:30:17 +06:00
|
|
|
|
using System;
|
|
|
|
|
|
using Umbraco.Core.Cache;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Cache
|
|
|
|
|
|
{
|
|
|
|
|
|
public sealed class ApplicationTreeCacheRefresher : CacheRefresherBase<ApplicationTreeCacheRefresher>
|
|
|
|
|
|
{
|
2016-05-26 17:12:04 +02:00
|
|
|
|
public ApplicationTreeCacheRefresher(CacheHelper cacheHelper)
|
|
|
|
|
|
: base(cacheHelper)
|
|
|
|
|
|
{ }
|
2016-05-18 18:44:08 +02:00
|
|
|
|
|
2016-05-26 17:12:04 +02:00
|
|
|
|
#region Define
|
2016-05-18 18:44:08 +02:00
|
|
|
|
|
2017-07-11 19:21:13 +02:00
|
|
|
|
protected override ApplicationTreeCacheRefresher This => this;
|
2013-04-04 23:30:17 +06:00
|
|
|
|
|
2016-05-26 17:12:04 +02:00
|
|
|
|
public static readonly Guid UniqueId = Guid.Parse("0AC6C028-9860-4EA4-958D-14D39F45886E");
|
2013-04-04 23:30:17 +06:00
|
|
|
|
|
2016-05-26 17:12:04 +02:00
|
|
|
|
public override Guid RefresherUniqueId => UniqueId;
|
|
|
|
|
|
|
|
|
|
|
|
public override string Name => "Application Tree Cache Refresher";
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Refresher
|
2013-04-04 23:30:17 +06:00
|
|
|
|
|
|
|
|
|
|
public override void RefreshAll()
|
|
|
|
|
|
{
|
2016-05-18 18:44:08 +02:00
|
|
|
|
CacheHelper.RuntimeCache.ClearCacheItem(CacheKeys.ApplicationTreeCacheKey);
|
2014-03-20 12:36:13 +11:00
|
|
|
|
base.RefreshAll();
|
2013-04-04 23:30:17 +06:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void Refresh(int id)
|
|
|
|
|
|
{
|
|
|
|
|
|
Remove(id);
|
2014-03-20 12:36:13 +11:00
|
|
|
|
base.Refresh(id);
|
2013-04-04 23:30:17 +06:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void Remove(int id)
|
|
|
|
|
|
{
|
2016-05-18 18:44:08 +02:00
|
|
|
|
CacheHelper.RuntimeCache.ClearCacheItem(CacheKeys.ApplicationTreeCacheKey);
|
2014-03-20 12:36:13 +11:00
|
|
|
|
base.Remove(id);
|
2013-04-04 23:30:17 +06:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-05-26 17:12:04 +02:00
|
|
|
|
#endregion
|
2013-04-04 23:30:17 +06:00
|
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
|
}
|