2015-01-21 12:48:08 +11:00
|
|
|
using System;
|
|
|
|
|
using System.Linq.Expressions;
|
2015-12-20 17:09:46 +01:00
|
|
|
using LightInject;
|
2013-03-31 18:40:55 -02:00
|
|
|
using Umbraco.Core.ObjectResolution;
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.PublishedCache
|
|
|
|
|
{
|
2015-01-21 12:48:08 +11:00
|
|
|
//TODO: REmove this requirement, just use normal IoC and publicize IPublishedCaches
|
|
|
|
|
|
2013-03-31 18:40:55 -02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Resolves the IPublishedCaches object.
|
|
|
|
|
/// </summary>
|
2015-01-21 12:48:08 +11:00
|
|
|
internal sealed class PublishedCachesResolver : ContainerSingleObjectResolver<PublishedCachesResolver, IPublishedCaches>
|
2013-03-31 18:40:55 -02:00
|
|
|
{
|
2015-01-21 12:48:08 +11:00
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes the resolver to use IoC
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="container"></param>
|
|
|
|
|
/// <param name="implementationType"></param>
|
|
|
|
|
public PublishedCachesResolver(IServiceContainer container, Type implementationType) : base(container, implementationType)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-03-31 18:40:55 -02:00
|
|
|
/// Initializes a new instance of the <see cref="PublishedCachesResolver"/> class with caches.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="caches">The caches.</param>
|
|
|
|
|
/// <remarks>The resolver is created by the <c>WebBootManager</c> and thus the constructor remains internal.</remarks>
|
|
|
|
|
internal PublishedCachesResolver(IPublishedCaches caches)
|
|
|
|
|
: base(caches)
|
|
|
|
|
{ }
|
|
|
|
|
|
2015-01-21 12:48:08 +11:00
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes the resolver to use IoC
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="container"></param>
|
|
|
|
|
/// <param name="implementationType"></param>
|
2015-12-20 17:09:46 +01:00
|
|
|
public PublishedCachesResolver(IServiceContainer container, Func<IServiceFactory, IPublishedCaches> implementationType) : base(container, implementationType)
|
2015-01-21 12:48:08 +11:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-03-31 18:40:55 -02:00
|
|
|
/// Sets the caches.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="caches">The caches.</param>
|
|
|
|
|
/// <remarks>For developers, at application startup.</remarks>
|
2013-09-05 17:47:13 +02:00
|
|
|
public void SetCaches(IPublishedCaches caches)
|
2013-03-31 18:40:55 -02:00
|
|
|
{
|
|
|
|
|
Value = caches;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the caches.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IPublishedCaches Caches
|
|
|
|
|
{
|
|
|
|
|
get { return Value; }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|