using System;
using Umbraco.Core;
using Umbraco.Core.Cache;
namespace Umbraco.Web.PublishedCache.XmlPublishedCache
{
///
/// Implements a published snapshot.
///
class PublishedShapshot : IPublishedShapshot
{
///
/// Initializes a new instance of the class with a content cache
/// and a media cache.
///
public PublishedShapshot(
PublishedContentCache contentCache,
PublishedMediaCache mediaCache,
PublishedMemberCache memberCache,
DomainCache domainCache)
{
ContentCache = contentCache;
MediaCache = mediaCache;
MemberCache = memberCache;
DomainCache = domainCache;
}
///
public IPublishedContentCache ContentCache { get; }
///
public IPublishedMediaCache MediaCache { get; }
///
public IPublishedMemberCache MemberCache { get; }
///
public IDomainCache DomainCache { get; }
///
public ICacheProvider SnapshotCache => null;
///
public ICacheProvider ElementsCache => null;
///
public IDisposable ForcedPreview(bool preview, Action callback = null)
{
// the XML cache does not support forcing preview, really, so, just pretend...
return new ForcedPreviewObject();
}
private class ForcedPreviewObject : DisposableObject
{
protected override void DisposeResources()
{ }
}
}
}