public PlaceholderRenderer(ICompositeViewEngine viewEngine, IViewComponentHelper viewComponentHelper, ISitecoreService sitecoreService, IOptions <ApiSettings> apiSettings)
 {
     _viewEngine          = viewEngine;
     _viewComponentHelper = viewComponentHelper;
     _sitecoreService     = sitecoreService;
     _baseAddress         = new Uri(new Uri(apiSettings.Value.BaseUrl), apiSettings.Value.PageDataApiPath);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlHelper{TModel}"/> class.
 /// </summary>
 public HtmlHelper(
     [NotNull] IHtmlGenerator htmlGenerator,
     [NotNull] ICompositeViewEngine viewEngine,
     [NotNull] IModelMetadataProvider metadataProvider)
     : base(htmlGenerator, viewEngine, metadataProvider)
 {
 }
Ejemplo n.º 3
0
 public SampleTagHelper(
     ICompositeViewEngine viewEngine,
     IViewBufferScope viewBufferScope) : base(viewEngine, viewBufferScope)
 {
     Model = this;
     Name  = "_Sample";
 }
Ejemplo n.º 4
0
 public CssController(IOptionsSnapshot <BackgroundSetting> bgSetting, ICompositeViewEngine viewEngine, IActionContextAccessor actionAccessor, ConstantUtil constantUtil)
 {
     _bgSetting      = bgSetting.Value;
     _viewEngine     = viewEngine;
     _actionAccessor = actionAccessor;
     _constantUtil   = constantUtil;
 }
Ejemplo n.º 5
0
 public QuoteController(IOptions <SmtpSettings> smtpSettings, ICompositeViewEngine viewEngine, IPurchaseOrderRepository purchaseOrderRepository, IDiscountModelRepository discountModelRepository)
 {
     _smtpSettings           = smtpSettings;
     _viewEngine             = viewEngine;
     PurchaseOrderRepository = purchaseOrderRepository;
     DiscountModelRepository = discountModelRepository;
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Creates a new <see cref="ViewExecutor"/>.
        /// </summary>
        /// <param name="viewOptions">The <see cref="IOptions{MvcViewOptions}"/>.</param>
        /// <param name="writerFactory">The <see cref="IHttpResponseStreamWriterFactory"/>.</param>
        /// <param name="viewEngine">The <see cref="ICompositeViewEngine"/>.</param>
        /// <param name="diagnosticSource">The <see cref="DiagnosticSource"/>.</param>
        public ViewExecutor(
            IOptions <MvcViewOptions> viewOptions,
            IHttpResponseStreamWriterFactory writerFactory,
            ICompositeViewEngine viewEngine,
            DiagnosticSource diagnosticSource)
        {
            if (viewOptions == null)
            {
                throw new ArgumentNullException(nameof(viewOptions));
            }

            if (writerFactory == null)
            {
                throw new ArgumentNullException(nameof(writerFactory));
            }

            if (viewEngine == null)
            {
                throw new ArgumentNullException(nameof(viewEngine));
            }

            if (diagnosticSource == null)
            {
                throw new ArgumentNullException(nameof(diagnosticSource));
            }

            ViewOptions      = viewOptions.Value;
            WriterFactory    = writerFactory;
            ViewEngine       = viewEngine;
            DiagnosticSource = diagnosticSource;
        }
Ejemplo n.º 7
0
        private static HtmlHelper <TModel> GetHtmlHelper <TModel>(
            ViewDataDictionary <TModel> viewData,
            IUrlHelper urlHelper,
            ICompositeViewEngine viewEngine,
            IModelMetadataProvider provider,
            Func <IHtmlHelper, IHtmlHelper> innerHelperWrapper,
            IHtmlGenerator htmlGenerator)
        {
            var httpContext   = new DefaultHttpContext();
            var actionContext = new ActionContext(httpContext, new RouteData(), new ActionDescriptor());

            var bindingContext = new ActionBindingContext()
            {
                ValidatorProvider = new DataAnnotationsModelValidatorProvider(),
            };

            var bindingContextAccessor = new MockScopedInstance <ActionBindingContext>();

            bindingContextAccessor.Value = bindingContext;

            var serviceProvider = new Mock <IServiceProvider>();

            serviceProvider
            .Setup(s => s.GetService(typeof(ICompositeViewEngine)))
            .Returns(viewEngine);
            serviceProvider
            .Setup(s => s.GetService(typeof(IUrlHelper)))
            .Returns(urlHelper);
            serviceProvider
            .Setup(s => s.GetService(typeof(IViewComponentHelper)))
            .Returns(new Mock <IViewComponentHelper>().Object);

            httpContext.RequestServices = serviceProvider.Object;
            if (htmlGenerator == null)
            {
                htmlGenerator = new DefaultHtmlGenerator(
                    GetAntiForgeryInstance(),
                    bindingContextAccessor,
                    provider,
                    urlHelper);
            }

            // TemplateRenderer will Contextualize this transient service.
            var innerHelper = (IHtmlHelper) new HtmlHelper(htmlGenerator, viewEngine, provider);

            if (innerHelperWrapper != null)
            {
                innerHelper = innerHelperWrapper(innerHelper);
            }
            serviceProvider
            .Setup(s => s.GetService(typeof(IHtmlHelper)))
            .Returns(() => innerHelper);

            var htmlHelper  = new HtmlHelper <TModel>(htmlGenerator, viewEngine, provider);
            var viewContext = new ViewContext(actionContext, Mock.Of <IView>(), viewData, new StringWriter());

            htmlHelper.Contextualize(viewContext);

            return(htmlHelper);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Creates a new <see cref="ViewExecutor"/>.
        /// </summary>
        /// <param name="viewOptions">The <see cref="IOptions{MvcViewOptions}"/>.</param>
        /// <param name="writerFactory">The <see cref="IHttpResponseStreamWriterFactory"/>.</param>
        /// <param name="viewEngine">The <see cref="ICompositeViewEngine"/>.</param>
        /// <param name="tempDataFactory">The <see cref="ITempDataDictionaryFactory"/>.</param>
        /// <param name="diagnosticListener">The <see cref="DiagnosticListener"/>.</param>
        /// <param name="modelMetadataProvider">The <see cref="IModelMetadataProvider" />.</param>
        public ViewExecutor(
            IOptions <MvcViewOptions> viewOptions,
            IHttpResponseStreamWriterFactory writerFactory,
            ICompositeViewEngine viewEngine,
            ITempDataDictionaryFactory tempDataFactory,
            DiagnosticListener diagnosticListener,
            IModelMetadataProvider modelMetadataProvider)
            : this(writerFactory, viewEngine, diagnosticListener)
        {
            if (viewOptions == null)
            {
                throw new ArgumentNullException(nameof(viewOptions));
            }

            if (tempDataFactory == null)
            {
                throw new ArgumentNullException(nameof(tempDataFactory));
            }

            if (diagnosticListener == null)
            {
                throw new ArgumentNullException(nameof(diagnosticListener));
            }

            ViewOptions           = viewOptions.Value;
            TempDataFactory       = tempDataFactory;
            ModelMetadataProvider = modelMetadataProvider;
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="appJobCallbackGet">Задание на получение обратного вызова.</param>
 /// <param name="appJobChallengeGet">Задание на отправку вызова.</param>
 /// <param name="appJobUserEntityCreate">Задание на создание сущности пользователя.</param>
 /// <param name="extClientStore">Хранилище клиентов.</param>
 /// <param name="extEvents">События.</param>
 /// <param name="extInteraction">Взаимодействие.</param>
 /// <param name="extLogger">Регистратор.</param>
 /// <param name="extRoleManager">Менеджер ролей.</param>
 /// <param name="extSignInManager">Менеджер входа в систему.</param>
 /// <param name="extUserManager">Менеджер пользователей.</param>
 /// <param name="extViewEngine">Средство создания представлений.</param>
 public ModIdentityServerWebMvcPartExternalModel(
     ModIdentityServerWebMvcPartExternalJobCallbackGetService appJobCallbackGet,
     ModIdentityServerWebMvcPartExternalJobChallengeGetService appJobChallengeGet,
     HostBasePartAuthJobUserEntityCreateService appJobUserEntityCreate,
     IClientStore extClientStore,
     IEventService extEvents,
     IIdentityServerInteractionService extInteraction,
     ILogger <ModIdentityServerWebMvcPartExternalModel> extLogger,
     RoleManager <DataEntityObjectRole> extRoleManager,
     SignInManager <DataEntityObjectUser> extSignInManager,
     UserManager <DataEntityObjectUser> extUserManager,
     ICompositeViewEngine extViewEngine
     )
     : base(extLogger, extViewEngine)
 {
     AppJobCallbackGet      = appJobCallbackGet;
     AppJobChallengeGet     = appJobChallengeGet;
     AppJobUserEntityCreate = appJobUserEntityCreate;
     ExtClientStore         = extClientStore;
     ExtEvents        = extEvents;
     ExtInteraction   = extInteraction;
     ExtRoleManager   = extRoleManager;
     ExtSignInManager = extSignInManager;
     ExtUserManager   = extUserManager;
 }
Ejemplo n.º 10
0
    public TemplateRenderer(
        IUmbracoContextAccessor umbracoContextAccessor,
        IPublishedRouter publishedRouter,
        IFileService fileService,
        ILocalizationService textService,
        IOptionsMonitor <WebRoutingSettings> webRoutingSettings,
        IHttpContextAccessor httpContextAccessor,
        ICompositeViewEngine viewEngine,
        IModelMetadataProvider modelMetadataProvider,
        ITempDataDictionaryFactory tempDataDictionaryFactory)
    {
        _umbracoContextAccessor =
            umbracoContextAccessor ?? throw new ArgumentNullException(nameof(umbracoContextAccessor));
        _publishedRouter    = publishedRouter ?? throw new ArgumentNullException(nameof(publishedRouter));
        _fileService        = fileService ?? throw new ArgumentNullException(nameof(fileService));
        _languageService    = textService ?? throw new ArgumentNullException(nameof(textService));
        _webRoutingSettings = webRoutingSettings.CurrentValue ??
                              throw new ArgumentNullException(nameof(webRoutingSettings));
        _httpContextAccessor       = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor));
        _viewEngine                = viewEngine ?? throw new ArgumentNullException(nameof(viewEngine));
        _modelMetadataProvider     = modelMetadataProvider;
        _tempDataDictionaryFactory = tempDataDictionaryFactory;

        webRoutingSettings.OnChange(x => _webRoutingSettings = x);
    }
Ejemplo n.º 11
0
 public ReplyController(
     IOptions <AppSettingsModel> appSettings,
     BlogContext db,
     UsersContext udb,
     AdminUtil adminUtil,
     BlogUtil blogUtil,
     ExpUtil expUtil,
     MessageUtil msgUtil,
     RatingUtil ratingUtil,
     IWebHostEnvironment env,
     IMemoryCache cache,
     ICompositeViewEngine viewEngine,
     IActionContextAccessor actionAccessor,
     HtmlSanitizerService sanitizerService)
 {
     _appSettings      = appSettings.Value;
     _db               = db;
     _udb              = udb;
     _adminUtil        = adminUtil;
     _blogUtil         = blogUtil;
     _cache            = cache;
     _env              = env;
     _expUtil          = expUtil;
     _ratingUtil       = ratingUtil;
     _msgUtil          = msgUtil;
     _viewEngine       = viewEngine;
     _actionAccessor   = actionAccessor;
     _sanitizerService = sanitizerService;
 }
Ejemplo n.º 12
0
 public CommentController(FujiyBlogDatabase db, SettingRepository settings, ICompositeViewEngine viewEngine, IEmailSender emailSender)
 {
     this.db          = db;
     this.settings    = settings;
     this.viewEngine  = viewEngine;
     this.emailSender = emailSender;
 }
Ejemplo n.º 13
0
        /// <summary>
        /// Creates a new <see cref="ViewExecutor"/>.
        /// </summary>
        /// <param name="viewOptions">The <see cref="IOptions{MvcViewOptions}"/>.</param>
        /// <param name="writerFactory">The <see cref="IHttpResponseStreamWriterFactory"/>.</param>
        /// <param name="viewEngine">The <see cref="ICompositeViewEngine"/>.</param>
        /// <param name="diagnosticSource">The <see cref="DiagnosticSource"/>.</param>
        public ViewExecutor(
            IOptions<MvcViewOptions> viewOptions,
            IHttpResponseStreamWriterFactory writerFactory,
            ICompositeViewEngine viewEngine,
            DiagnosticSource diagnosticSource)
        {
            if (viewOptions == null)
            {
                throw new ArgumentNullException(nameof(viewOptions));
            }

            if (writerFactory == null)
            {
                throw new ArgumentNullException(nameof(writerFactory));
            }

            if (viewEngine == null)
            {
                throw new ArgumentNullException(nameof(viewEngine));
            }

            if (diagnosticSource == null)
            {
                throw new ArgumentNullException(nameof(diagnosticSource));
            }

            ViewOptions = viewOptions.Value;
            WriterFactory = writerFactory;
            ViewEngine = viewEngine;
            DiagnosticSource = diagnosticSource;
        }
Ejemplo n.º 14
0
 public AngularHtmlHelper(
     IHtmlGenerator generator,
     ICompositeViewEngine viewEngine,
     IModelMetadataProvider metadataProvider)
     : base(generator, viewEngine, metadataProvider)
 {
 }
Ejemplo n.º 15
0
        public static async Task <string> RenderPartialViewToStringAsync(
            this Controller controller,
            ICompositeViewEngine viewEngine,
            string viewName,
            object model)
        {
            if (string.IsNullOrEmpty(viewName))
            {
                viewName = controller.ControllerContext.ActionDescriptor.ActionName;
            }

            controller.ViewData.Model = model;

            using (var writer = new StringWriter())
            {
                ViewEngineResult viewResult =
                    viewEngine.FindView(controller.ControllerContext, viewName, false);

                ViewContext viewContext = new ViewContext(
                    controller.ControllerContext,
                    viewResult.View,
                    controller.ViewData,
                    controller.TempData,
                    writer,
                    new HtmlHelperOptions()
                    );

                await viewResult.View.RenderAsync(viewContext);

                return(writer.GetStringBuilder().ToString());
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HtmlHelper{TModel}"/> class.
        /// </summary>
        public HtmlHelper(
            IHtmlGenerator htmlGenerator,
            ICompositeViewEngine viewEngine,
            IModelMetadataProvider metadataProvider,
#pragma warning disable PUB0001 // Pubternal type in public API
            IViewBufferScope bufferScope,
#pragma warning restore PUB0001
            HtmlEncoder htmlEncoder,
            UrlEncoder urlEncoder,
#pragma warning disable PUB0001 // Pubternal type in public API
            ExpressionTextCache expressionTextCache
#pragma warning restore PUB0001
            )
            : base(
                htmlGenerator,
                viewEngine,
                metadataProvider,
                bufferScope,
                htmlEncoder,
                urlEncoder)
        {
            if (expressionTextCache == null)
            {
                throw new ArgumentNullException(nameof(expressionTextCache));
            }

            _expressionTextCache = expressionTextCache;
        }
        public void GlobalSetup()
        {
            var loader        = new RazorCompiledItemLoader();
            var viewsDll      = Path.ChangeExtension(typeof(ViewAssemblyMarker).Assembly.Location, "Views.dll");
            var viewsAssembly = Assembly.Load(File.ReadAllBytes(viewsDll));
            var services      = new ServiceCollection();
            var listener      = new DiagnosticListener(GetType().Assembly.FullName);
            var partManager   = new ApplicationPartManager();

            partManager.ApplicationParts.Add(CompiledRazorAssemblyApplicationPartFactory.GetDefaultApplicationParts(viewsAssembly).Single());
            var builder = services
                          .AddSingleton <ILoggerFactory, NullLoggerFactory>()
                          .AddSingleton <ObjectPoolProvider, DefaultObjectPoolProvider>()
                          .AddSingleton <DiagnosticSource>(listener)
                          .AddSingleton(listener)
                          .AddSingleton <IWebHostEnvironment, BenchmarkHostingEnvironment>()
                          .AddSingleton <ApplicationPartManager>(partManager)
                          .AddScoped <BenchmarkViewExecutor>()
                          .AddMvc();

            _serviceProvider           = services.BuildServiceProvider();
            _routeData                 = new RouteData();
            _actionDescriptor          = new ActionDescriptor();
            _tempDataDictionaryFactory = _serviceProvider.GetRequiredService <ITempDataDictionaryFactory>();
            _viewEngine                = _serviceProvider.GetRequiredService <ICompositeViewEngine>();
        }
Ejemplo n.º 18
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="appJobLoginGet">Задание на получение входа в систему.</param>
 /// <param name="appJobLoginPost">Задание на отправку входа в систему.</param>
 /// <param name="appJobLogoutGet">Задание на получение выхода из системы.</param>
 /// <param name="appJobLogoutPost">Задание на отправку выхода из системы.</param>
 /// <param name="extClientStore">Хранилище клиентов.</param>
 /// <param name="extEvents">События.</param>
 /// <param name="extInteraction">Взаимодействие.</param>
 /// <param name="extLogger">Регистратор.</param>
 /// <param name="extSchemeProvider">Поставщик схем.</param>
 /// <param name="extSignInManager">Менеджер входа в систему.</param>
 /// <param name="extUserManager">Менеджер пользователей.</param>
 /// <param name="extViewEngine">Средство создания представлений.</param>
 public ModIdentityServerWebMvcPartAccountModel(
     ModIdentityServerWebMvcPartAccountJobLoginGetService appJobLoginGet,
     ModIdentityServerWebMvcPartAccountJobLoginPostService appJobLoginPost,
     ModIdentityServerWebMvcPartAccountJobLogoutGetService appJobLogoutGet,
     ModIdentityServerWebMvcPartAccountJobLogoutPostService appJobLogoutPost,
     IClientStore extClientStore,
     IEventService extEvents,
     IIdentityServerInteractionService extInteraction,
     ILogger <ModIdentityServerWebMvcPartAccountModel> extLogger,
     IAuthenticationSchemeProvider extSchemeProvider,
     SignInManager <DataEntityObjectUser> extSignInManager,
     UserManager <DataEntityObjectUser> extUserManager,
     ICompositeViewEngine extViewEngine
     )
     : base(extLogger, extViewEngine)
 {
     AppJobLoginGet    = appJobLoginGet;
     AppJobLoginPost   = appJobLoginPost;
     AppJobLogoutGet   = appJobLogoutGet;
     AppJobLogoutPost  = appJobLogoutPost;
     ExtClientStore    = extClientStore;
     ExtEvents         = extEvents;
     ExtInteraction    = extInteraction;
     ExtSchemeProvider = extSchemeProvider;
     ExtSignInManager  = extSignInManager;
     ExtUserManager    = extUserManager;
 }
Ejemplo n.º 19
0
 public HomeController(NorthwindDbContext context, ICompositeViewEngine compositeViewEngine) : base(compositeViewEngine)
 {
     _orderRepository        = new OrdersRepository(context);
     _orderDetailsRepository = new OrderDetailsRepository(context);
     _customersRepository    = new CustomersRepository(context);
     _shippersRepository     = new ShippersRepository(context);
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Constructs the service.
 /// </summary>
 /// <param name="settings">An instance of <see cref="EmailServiceSettings"/> used to initialize the service.</param>
 /// <param name="viewEngine">Represents an <see cref="IViewEngine"/> that delegates to one of a collection of view engines.</param>
 /// <param name="tempDataProvider">Defines the contract for temporary-data providers that store data that is viewed on the next request.</param>
 /// <param name="httpContextAccessor">Used to access the <see cref="HttpContext"/> through the <see cref="IHttpContextAccessor"/> interface and its default implementation <see cref="HttpContextAccessor"/>.</param>
 /// <param name="serviceProvider">Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
 public EmailServiceSmtpRazor(
     EmailServiceSettings settings,
     ICompositeViewEngine viewEngine,
     ITempDataProvider tempDataProvider,
     IHttpContextAccessor httpContextAccessor,
     IServiceProvider serviceProvider
     ) : base(viewEngine, tempDataProvider, httpContextAccessor, serviceProvider) => _settings = settings ?? throw new ArgumentNullException(nameof(settings));
Ejemplo n.º 21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TemplateService"/> class.
 /// </summary>
 /// <param name="viewEngine">The view engine.</param>
 /// <param name="bufferScope">The buffer scope.</param>
 /// <param name="templateProvider">The template provider.</param>
 public TemplateService(
     ICompositeViewEngine viewEngine,
     IViewBufferScope bufferScope,
     ITemplateProvider templateProvider)
     : this((IViewEngine)viewEngine, bufferScope, templateProvider)
 {
 }
Ejemplo n.º 22
0
 public MaintenanceController(UserManager <ApplicationUser> userManager,
                              RoleManager <ApplicationRole> roleManager,
                              ICompositeViewEngine viewEngine) : base(viewEngine)
 {
     this._userManager = userManager;
     this._roleManager = roleManager;
 }
Ejemplo n.º 23
0
        protected async Task <string> RenderPartialViewToString(ICompositeViewEngine viewEngine, string viewName, object model)
        {
            if (string.IsNullOrEmpty(viewName))
            {
                viewName = ControllerContext.ActionDescriptor.ActionName;
            }

            ViewData.Model = model;

            using (var writer = new StringWriter())
            {
                string           path       = (new Uri(Assembly.GetExecutingAssembly().CodeBase)).AbsolutePath;
                ViewEngineResult viewResult =
                    viewEngine.GetView(path, viewName, false);

                ViewContext viewContext = new ViewContext(
                    ControllerContext,
                    viewResult.View,
                    ViewData,
                    TempData,
                    writer,
                    new HtmlHelperOptions()
                    );

                await viewResult.View.RenderAsync(viewContext);

                return(writer.GetStringBuilder().ToString());
            }
        }
 public AuthorizationMiddleware(RequestDelegate next, IWebHostEnvironment environment, ICompositeViewEngine engine, ITempDataProvider tempDataProvider)
 {
     _next                 = next;
     viewEngine            = engine;
     this.environment      = environment;
     this.tempDataProvider = tempDataProvider;
 }
Ejemplo n.º 25
0
 public BlogController(IDataService db, IFeedService ss, SignInManager <AppUser> sm, ICompositeViewEngine viewEngine)
 {
     _db         = db;
     _ss         = ss;
     _sm         = sm;
     _viewEngine = viewEngine;
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlHelper{TModel}"/> class.
 /// </summary>
 public HtmlHelper(
     IHtmlGenerator htmlGenerator,
     ICompositeViewEngine viewEngine,
     IModelMetadataProvider metadataProvider,
     IHtmlEncoder htmlEncoder,
     IUrlEncoder urlEncoder,
     IJavaScriptStringEncoder javaScriptStringEncoder)
     : base(htmlGenerator, viewEngine, metadataProvider, htmlEncoder, urlEncoder, javaScriptStringEncoder)
 {
     if (htmlGenerator == null)
     {
         throw new ArgumentNullException(nameof(htmlGenerator));
     }
     if (viewEngine == null)
     {
         throw new ArgumentNullException(nameof(viewEngine));
     }
     if (metadataProvider == null)
     {
         throw new ArgumentNullException(nameof(metadataProvider));
     }
     if (htmlEncoder == null)
     {
         throw new ArgumentNullException(nameof(htmlEncoder));
     }
     if (urlEncoder == null)
     {
         throw new ArgumentNullException(nameof(urlEncoder));
     }
     if (javaScriptStringEncoder == null)
     {
         throw new ArgumentNullException(nameof(javaScriptStringEncoder));
     }
 }
Ejemplo n.º 27
0
 public RazorViewRenderService(ICompositeViewEngine viewEngine, IHttpContextAccessor httpContextAccessor, IViewLocator viewLocator, HtmlEncoder htmlEncoder)
 {
     this.viewEngine          = viewEngine ?? throw new ArgumentNullException(nameof(viewEngine));
     this.httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor));
     this.viewLocator         = viewLocator ?? throw new ArgumentNullException(nameof(viewLocator));
     this.htmlEncoder         = htmlEncoder ?? throw new ArgumentNullException(nameof(htmlEncoder));
 }
Ejemplo n.º 28
0
 public PartialViewInvoker(
     ILogger <PartialViewInvoker> logger,
     ICompositeViewEngine viewEngine)
 {
     _logger     = logger ?? throw new ArgumentNullException(nameof(logger));
     _viewEngine = viewEngine ?? throw new ArgumentNullException(nameof(viewEngine));
 }
 public PocoComponent(
     FileListContext context,
     ICompositeViewEngine viewEngine)
 {
     _context    = context;
     _viewEngine = viewEngine;
 }
Ejemplo n.º 30
0
 /// <summary>
 /// Creates a new <see cref="PartialTagHelper"/>.
 /// </summary>
 /// <param name="viewEngine">The <see cref="ICompositeViewEngine"/> used to locate the partial view.</param>
 /// <param name="viewBufferScope">The <see cref="IViewBufferScope"/>.</param>
 public PartialTagHelper(
     ICompositeViewEngine viewEngine,
     IViewBufferScope viewBufferScope)
 {
     _viewEngine      = viewEngine ?? throw new ArgumentNullException(nameof(viewEngine));
     _viewBufferScope = viewBufferScope ?? throw new ArgumentNullException(nameof(viewBufferScope));
 }
Ejemplo n.º 31
0
 public HtmlEngineFactory(IHttpContextAccessor httpContextAccessor, ICompositeViewEngine viewEngine, ITempDataProvider tempDataProvider, IApplicationEnvironment hostingEnvironment)
 {
     _httpContextAccessor = httpContextAccessor;
     _viewEngine = viewEngine;
     _tempDataProvider = tempDataProvider;
     _hostingEnvironment = hostingEnvironment;
 }
 public DisplayForTagHelper(IModelMetadataProvider modelMetadataProvider, ICompositeViewEngine viewEngine,
                            IViewBufferScope viewBufferScope)
 {
     _modelMetadataProvider = modelMetadataProvider;
     _viewEngine            = viewEngine;
     _viewBufferScope       = viewBufferScope;
 }
 public RazorViewRenderer(
     ICompositeViewEngine viewEngine,
     ITempDataProvider tempDataProvider,
     ILogger logger)
 {
     _viewEngine = viewEngine;
     _tempDataProvider = tempDataProvider;
     _logger = logger;
 }
Ejemplo n.º 34
0
        /// <summary>
        /// Creates a new <see cref="PartialViewResultExecutor"/>.
        /// </summary>
        /// <param name="viewOptions">The <see cref="IOptions{MvcViewOptions}"/>.</param>
        /// <param name="writerFactory">The <see cref="IHttpResponseStreamWriterFactory"/>.</param>
        /// <param name="viewEngine">The <see cref="ICompositeViewEngine"/>.</param>
        /// <param name="diagnosticSource">The <see cref="DiagnosticSource"/>.</param>
        /// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
        public PartialViewResultExecutor(
            IOptions<MvcViewOptions> viewOptions,
            IHttpResponseStreamWriterFactory writerFactory,
            ICompositeViewEngine viewEngine,
            DiagnosticSource diagnosticSource,
            ILoggerFactory loggerFactory)
            : base(viewOptions, writerFactory, viewEngine, diagnosticSource)
        {
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            Logger = loggerFactory.CreateLogger<PartialViewResultExecutor>();
        }
Ejemplo n.º 35
0
 public InvoicesController(IProjectInvoicesManager invoiceManager,
     UserManager<AppUser> userManager,
     ICompositeViewEngine viewEngine,
     ITempDataProvider tempDataProvider,
     IHttpContextAccessor httpContextAccessor,
     IApplicationEnvironment hostingEnvironment,
     DatabaseContext dbContext)
 {
     _invoiceManager = invoiceManager;
     _viewEngine = viewEngine;
     _tempDataProvider = tempDataProvider;
     _httpContextAccessor = httpContextAccessor;
     _hostingEnvironment = hostingEnvironment;
     _dbContext = dbContext;
     _userManager = userManager;
 }
Ejemplo n.º 36
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HtmlHelper"/> class.
        /// </summary>
        public HtmlHelper(
            [NotNull] ICompositeViewEngine viewEngine,
            [NotNull] IModelMetadataProvider metadataProvider,
            [NotNull] IUrlHelper urlHelper,
            [NotNull] AntiForgery antiForgeryInstance,
            [NotNull] IActionBindingContextProvider actionBindingContextProvider)
        {
            _viewEngine = viewEngine;
            MetadataProvider = metadataProvider;
            _urlHelper = urlHelper;
            _antiForgeryInstance = antiForgeryInstance;
            _actionBindingContextProvider = actionBindingContextProvider;

            // Underscores are fine characters in id's.
            IdAttributeDotReplacement = "_";
        }
Ejemplo n.º 37
0
        /// <summary>
        /// Creates a new <see cref="ViewResultExecutor"/>.
        /// </summary>
        /// <param name="viewOptions">The <see cref="IOptions{MvcViewOptions}"/>.</param>
        /// <param name="writerFactory">The <see cref="IHttpResponseStreamWriterFactory"/>.</param>
        /// <param name="viewEngine">The <see cref="ICompositeViewEngine"/>.</param>
        /// <param name="tempDataFactory">The <see cref="ITempDataDictionaryFactory"/>.</param>
        /// <param name="diagnosticSource">The <see cref="DiagnosticSource"/>.</param>
        /// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
        /// <param name="modelMetadataProvider">The <see cref="IModelMetadataProvider"/>.</param>
        public ViewResultExecutor(
            IOptions<MvcViewOptions> viewOptions,
            IHttpResponseStreamWriterFactory writerFactory,
            ICompositeViewEngine viewEngine,
            ITempDataDictionaryFactory tempDataFactory,
            DiagnosticSource diagnosticSource,
            ILoggerFactory loggerFactory,
            IModelMetadataProvider modelMetadataProvider)
            : base(viewOptions, writerFactory, viewEngine, tempDataFactory, diagnosticSource, modelMetadataProvider)
        {
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            Logger = loggerFactory.CreateLogger<ViewResultExecutor>();
        }
Ejemplo n.º 38
0
        /// <summary>
        /// Creates a new <see cref="ViewExecutor"/>.
        /// </summary>
        /// <param name="viewOptions">The <see cref="IOptions{MvcViewOptions}"/>.</param>
        /// <param name="writerFactory">The <see cref="IHttpResponseStreamWriterFactory"/>.</param>
        /// <param name="viewEngine">The <see cref="ICompositeViewEngine"/>.</param>
        /// <param name="tempDataFactory">The <see cref="ITempDataDictionaryFactory"/>.</param>
        /// <param name="diagnosticSource">The <see cref="DiagnosticSource"/>.</param>
        /// <param name="modelMetadataProvider">The <see cref="IModelMetadataProvider" />.</param>
        public ViewExecutor(
            IOptions<MvcViewOptions> viewOptions,
            IHttpResponseStreamWriterFactory writerFactory,
            ICompositeViewEngine viewEngine,
            ITempDataDictionaryFactory tempDataFactory,
            DiagnosticSource diagnosticSource,
            IModelMetadataProvider modelMetadataProvider)
        {
            if (viewOptions == null)
            {
                throw new ArgumentNullException(nameof(viewOptions));
            }

            if (writerFactory == null)
            {
                throw new ArgumentNullException(nameof(writerFactory));
            }

            if (viewEngine == null)
            {
                throw new ArgumentNullException(nameof(viewEngine));
            }

            if (tempDataFactory == null)
            {
                throw new ArgumentNullException(nameof(tempDataFactory));
            }

            if (diagnosticSource == null)
            {
                throw new ArgumentNullException(nameof(diagnosticSource));
            }

            if (modelMetadataProvider == null)
            {
                throw new ArgumentNullException(nameof(modelMetadataProvider));
            }

            ViewOptions = viewOptions.Value;
            WriterFactory = writerFactory;
            ViewEngine = viewEngine;
            TempDataFactory = tempDataFactory;
            DiagnosticSource = diagnosticSource;
            _modelMetadataProvider = modelMetadataProvider;
        }
Ejemplo n.º 39
0
 public ProjectInvoicesManager(DatabaseContext dbContext,
     ICompositeViewEngine viewEngine,
     ITempDataProvider tempDataProvider,
     IHttpContextAccessor httpContextAccessor,
     IApplicationEnvironment hostingEnvironment,
     IProjectWorkflowDefinitionFactory workflowDefinition,
     IProjectHistoryManager historyManager,
     IProjectAlertsManager alertsManager)
 {
     _dbContext = dbContext;
     _viewEngine = viewEngine;
     _tempDataProvider = tempDataProvider;
     _httpContextAccessor = httpContextAccessor;
     _hostingEnvironment = hostingEnvironment;
     _workflowDefinition = workflowDefinition;
     _historyManager = historyManager;
     _alertsManager = alertsManager;
 }
Ejemplo n.º 40
0
 public ViewExportRouter(ICompositeViewEngine viewEngine)
 {
     this.viewEngine = viewEngine;
 }
Ejemplo n.º 41
0
 public PartialTagHelper(ICompositeViewEngine viewEngine)
 {
     _viewEngine = viewEngine;
 }