2013-03-31 18:40:55 -02:00
|
|
|
|
namespace Umbraco.Web.PublishedCache
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Provides caches (content and media).
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>Default implementation for unrelated caches.</remarks>
|
|
|
|
|
|
class PublishedCaches : IPublishedCaches
|
|
|
|
|
|
{
|
2013-04-04 05:10:53 -02:00
|
|
|
|
private readonly IPublishedContentCache _contentCache;
|
|
|
|
|
|
private readonly IPublishedMediaCache _mediaCache;
|
|
|
|
|
|
|
2013-03-31 18:40:55 -02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initializes a new instance of the <see cref="PublishedCaches"/> class with a content cache
|
|
|
|
|
|
/// and a media cache.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public PublishedCaches(IPublishedContentCache contentCache, IPublishedMediaCache mediaCache)
|
|
|
|
|
|
{
|
2013-04-04 05:10:53 -02:00
|
|
|
|
_contentCache = contentCache;
|
|
|
|
|
|
_mediaCache = mediaCache;
|
2013-03-31 18:40:55 -02:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-04-04 05:09:26 -02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Creates a contextual content cache for a specified context.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="context">The context.</param>
|
|
|
|
|
|
/// <returns>A new contextual content cache for the specified context.</returns>
|
|
|
|
|
|
public ContextualPublishedContentCache CreateContextualContentCache(UmbracoContext context)
|
|
|
|
|
|
{
|
2013-04-04 05:10:53 -02:00
|
|
|
|
return new ContextualPublishedContentCache(_contentCache, context);
|
2013-04-04 05:09:26 -02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Creates a contextual media cache for a specified context.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="context">The context.</param>
|
|
|
|
|
|
/// <returns>A new contextual media cache for the specified context.</returns>
|
|
|
|
|
|
public ContextualPublishedMediaCache CreateContextualMediaCache(UmbracoContext context)
|
|
|
|
|
|
{
|
2013-04-04 05:10:53 -02:00
|
|
|
|
return new ContextualPublishedMediaCache(_mediaCache, context);
|
2013-04-04 05:09:26 -02:00
|
|
|
|
}
|
2013-03-31 18:40:55 -02:00
|
|
|
|
}
|
|
|
|
|
|
}
|