using System; using LightInject; using Umbraco.Core.ObjectResolution; namespace Umbraco.Core.Models.PublishedContent { /// /// Resolves the IPublishedContentModelFactory object. /// public class PublishedContentModelFactoryResolver : ContainerSingleObjectResolver { /// /// Initializes the resolver to use IoC /// /// /// internal PublishedContentModelFactoryResolver(IServiceContainer container, Type implementationType) : base(container, implementationType) { } /// /// Initializes a new instance of the . /// /// The resolver is created by the WebBootManager and thus the constructor remains internal. internal PublishedContentModelFactoryResolver() : base() { } /// /// Initializes a new instance of the with a factory. /// /// The factory. /// The resolver is created by the WebBootManager and thus the constructor remains internal. internal PublishedContentModelFactoryResolver(IPublishedContentModelFactory factory) : base(factory) { } /// /// Initialize the resolver to use IoC, when using this contructor the type must be set manually /// /// internal PublishedContentModelFactoryResolver(IServiceContainer container) : base(container) { } /// /// Sets the factory. /// /// The factory. /// For developers, at application startup. public void SetFactory(IPublishedContentModelFactory factory) { Value = factory; } /// /// Gets the factory. /// public IPublishedContentModelFactory Factory { get { return Value; } } } }