2016-06-09 18:45:16 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using Umbraco.Core;
|
2017-09-29 15:51:33 +02:00
|
|
|
|
using Umbraco.Core.Cache;
|
2016-06-09 18:45:16 +02:00
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
2016-05-26 17:12:04 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2017-10-31 12:48:24 +01:00
|
|
|
|
/// Implements a published snapshot.
|
2016-05-26 17:12:04 +02:00
|
|
|
|
/// </summary>
|
2017-10-31 12:48:24 +01:00
|
|
|
|
class PublishedShapshot : IPublishedShapshot
|
2016-05-26 17:12:04 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2017-10-31 12:48:24 +01:00
|
|
|
|
/// Initializes a new instance of the <see cref="PublishedShapshot"/> class with a content cache
|
2016-05-26 17:12:04 +02:00
|
|
|
|
/// and a media cache.
|
|
|
|
|
|
/// </summary>
|
2017-10-31 12:48:24 +01:00
|
|
|
|
public PublishedShapshot(
|
2016-05-26 17:12:04 +02:00
|
|
|
|
PublishedContentCache contentCache,
|
|
|
|
|
|
PublishedMediaCache mediaCache,
|
|
|
|
|
|
PublishedMemberCache memberCache,
|
|
|
|
|
|
DomainCache domainCache)
|
|
|
|
|
|
{
|
2017-10-31 12:50:30 +01:00
|
|
|
|
Content = contentCache;
|
|
|
|
|
|
Media = mediaCache;
|
|
|
|
|
|
Members = memberCache;
|
|
|
|
|
|
Domains = domainCache;
|
2016-05-26 17:12:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-09-29 15:51:33 +02:00
|
|
|
|
/// <inheritdoc />
|
2017-10-31 12:50:30 +01:00
|
|
|
|
public IPublishedContentCache Content { get; }
|
2016-05-26 17:12:04 +02:00
|
|
|
|
|
2017-09-29 15:51:33 +02:00
|
|
|
|
/// <inheritdoc />
|
2017-10-31 12:50:30 +01:00
|
|
|
|
public IPublishedMediaCache Media { get; }
|
2016-05-26 17:12:04 +02:00
|
|
|
|
|
2017-09-29 15:51:33 +02:00
|
|
|
|
/// <inheritdoc />
|
2017-10-31 12:50:30 +01:00
|
|
|
|
public IPublishedMemberCache Members { get; }
|
2016-05-26 17:12:04 +02:00
|
|
|
|
|
2017-09-29 15:51:33 +02:00
|
|
|
|
/// <inheritdoc />
|
2017-10-31 12:50:30 +01:00
|
|
|
|
public IDomainCache Domains { get; }
|
2016-06-09 18:45:16 +02:00
|
|
|
|
|
2017-09-29 15:51:33 +02:00
|
|
|
|
/// <inheritdoc />
|
2017-10-31 12:48:24 +01:00
|
|
|
|
public ICacheProvider SnapshotCache => null;
|
2017-09-29 15:51:33 +02:00
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2017-10-31 12:48:24 +01:00
|
|
|
|
public ICacheProvider ElementsCache => null;
|
2017-09-29 15:51:33 +02:00
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2016-06-09 18:45:16 +02:00
|
|
|
|
public IDisposable ForcedPreview(bool preview, Action<bool> 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()
|
|
|
|
|
|
{ }
|
|
|
|
|
|
}
|
2016-05-26 17:12:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|