Exemplo n.º 1
0
    public MacroRenderer(
        IProfilingLogger profilingLogger,
        ILogger <MacroRenderer> logger,
        IUmbracoContextAccessor umbracoContextAccessor,
        IOptionsMonitor <ContentSettings> contentSettings,
        ILocalizedTextService textService,
        AppCaches appCaches,
        IMacroService macroService,
        ICookieManager cookieManager,
        ISessionManager sessionManager,
        IRequestAccessor requestAccessor,
        PartialViewMacroEngine partialViewMacroEngine,
        IHttpContextAccessor httpContextAccessor,
        IWebHostEnvironment webHostEnvironment)
    {
        _profilingLogger        = profilingLogger ?? throw new ArgumentNullException(nameof(profilingLogger));
        _logger                 = logger;
        _umbracoContextAccessor =
            umbracoContextAccessor ?? throw new ArgumentNullException(nameof(umbracoContextAccessor));
        _contentSettings        = contentSettings.CurrentValue ?? throw new ArgumentNullException(nameof(contentSettings));
        _textService            = textService;
        _appCaches              = appCaches ?? throw new ArgumentNullException(nameof(appCaches));
        _macroService           = macroService ?? throw new ArgumentNullException(nameof(macroService));
        _cookieManager          = cookieManager;
        _sessionManager         = sessionManager;
        _requestAccessor        = requestAccessor;
        _partialViewMacroEngine = partialViewMacroEngine;
        _httpContextAccessor    = httpContextAccessor;
        _webHostEnvironment     = webHostEnvironment;

        contentSettings.OnChange(x => _contentSettings = x);
    }
Exemplo n.º 2
0
 public MacroRenderer(
     IProfilingLogger profilingLogger,
     ILogger <MacroRenderer> logger,
     IUmbracoContextAccessor umbracoContextAccessor,
     IOptionsMonitor <ContentSettings> contentSettings,
     ILocalizedTextService textService,
     AppCaches appCaches,
     IMacroService macroService,
     IHostingEnvironment hostingEnvironment,
     ICookieManager cookieManager,
     ISessionManager sessionManager,
     IRequestAccessor requestAccessor,
     PartialViewMacroEngine partialViewMacroEngine,
     IHttpContextAccessor httpContextAccessor)
     : this(
         profilingLogger,
         logger,
         umbracoContextAccessor,
         contentSettings,
         textService,
         appCaches,
         macroService,
         cookieManager,
         sessionManager,
         requestAccessor,
         partialViewMacroEngine,
         httpContextAccessor,
         StaticServiceProvider.Instance.GetRequiredService <IWebHostEnvironment>())
 {
 }