2013-03-22 00:35:15 +06:00
|
|
|
|
using System;
|
|
|
|
|
|
using Umbraco.Core.Cache;
|
2014-01-28 12:20:10 +11:00
|
|
|
|
using Umbraco.Core.Models;
|
2015-01-13 13:33:39 +11:00
|
|
|
|
|
2013-03-22 00:35:15 +06:00
|
|
|
|
namespace Umbraco.Web.Cache
|
|
|
|
|
|
{
|
|
|
|
|
|
public sealed class LanguageCacheRefresher : CacheRefresherBase<LanguageCacheRefresher>
|
|
|
|
|
|
{
|
2016-05-26 17:12:04 +02:00
|
|
|
|
public LanguageCacheRefresher(CacheHelper cacheHelper)
|
|
|
|
|
|
: base(cacheHelper)
|
|
|
|
|
|
{ }
|
2016-05-18 18:44:08 +02:00
|
|
|
|
|
2016-05-26 17:12:04 +02:00
|
|
|
|
#region Define
|
2013-03-22 00:35:15 +06:00
|
|
|
|
|
2017-07-11 19:21:13 +02:00
|
|
|
|
protected override LanguageCacheRefresher This => this;
|
2013-03-22 00:35:15 +06:00
|
|
|
|
|
2016-05-26 17:12:04 +02:00
|
|
|
|
public static readonly Guid UniqueId = Guid.Parse("3E0F95D8-0BE5-44B8-8394-2B8750B62654");
|
|
|
|
|
|
|
|
|
|
|
|
public override Guid RefresherUniqueId => UniqueId;
|
|
|
|
|
|
|
|
|
|
|
|
public override string Name => "Language Cache Refresher";
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Refresher
|
2013-03-22 00:35:15 +06:00
|
|
|
|
|
|
|
|
|
|
public override void Refresh(int id)
|
|
|
|
|
|
{
|
2016-01-07 19:33:55 +01:00
|
|
|
|
ClearAllIsolatedCacheByEntityType<ILanguage>();
|
2013-03-22 00:35:15 +06:00
|
|
|
|
base.Refresh(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void Remove(int id)
|
2014-01-28 12:20:10 +11:00
|
|
|
|
{
|
2016-01-07 19:33:55 +01:00
|
|
|
|
ClearAllIsolatedCacheByEntityType<ILanguage>();
|
2016-01-07 18:44:04 +01:00
|
|
|
|
//if a language is removed, then all dictionary cache needs to be removed
|
2016-01-07 19:33:55 +01:00
|
|
|
|
ClearAllIsolatedCacheByEntityType<IDictionaryItem>();
|
2013-03-22 00:35:15 +06:00
|
|
|
|
base.Remove(id);
|
|
|
|
|
|
}
|
2016-05-26 17:12:04 +02:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
2013-03-22 00:35:15 +06:00
|
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
|
}
|