/// <summary>
 ///     Constructor to inject dependencies into the handler
 /// </summary>
 public XmlSitemapHandler(IDependencyFactory dependencyFactory)
 {
     _sitemapCache  = dependencyFactory.CreateCache();
     _generator     = dependencyFactory.CreateGenerator();
     _contentEngine = dependencyFactory.CreateEngine();
     _logger        = dependencyFactory.CreateLogger();
 }
Пример #2
0
        /// <summary>
        ///     Constructor for the sitemap handler
        /// </summary>
        public XmlSitemapHandler()
        {
            UmbracoContext.EnsureContext(
                new HttpContextWrapper(HttpContext.Current),
                ApplicationContext.Current,
                true);

            var factory = new WebConfigDependencyFactory();

            _sitemapCache  = factory.CreateCache();
            _generator     = factory.CreateGenerator();
            _contentEngine = factory.CreateEngine();
        }
        /// <summary>
        ///     Constructor for the sitemap handler
        /// </summary>
        public XmlSitemapHandler()
        {
            /*
             * UmbracoContext.EnsureContext(
             *  new HttpContextWrapper(HttpContext.Current),
             *  ApplicationContext.Current,
             *  true);
             */
            // TODO context ^. use providers. cleanup configuration folder and maybe file/folder organizing in project. update/add tests.

            var factory = new WebConfigDependencyFactory();

            _sitemapCache  = factory.CreateCache();
            _generator     = factory.CreateGenerator();
            _contentEngine = factory.CreateEngine();
            _logger        = factory.CreateLogger();
        }