public TagHelperDirectiveSpanVisitor( [NotNull] ITagHelperDescriptorResolver descriptorResolver, [NotNull] ErrorSink errorSink) { _descriptorResolver = descriptorResolver; _errorSink = errorSink; }
/// <summary> /// Initializes a new instance of <see cref="RazorParser"/>. /// </summary> /// <param name="codeParser">The <see cref="ParserBase"/> used for parsing code content.</param> /// <param name="markupParser">The <see cref="ParserBase"/> used for parsing markup content.</param> /// <param name="tagHelperDescriptorResolver">The <see cref="ITagHelperDescriptorResolver"/> used to resolve /// <see cref="TagHelperDescriptor"/>s.</param> public RazorParser([NotNull] ParserBase codeParser, [NotNull] ParserBase markupParser, ITagHelperDescriptorResolver tagHelperDescriptorResolver) : this(codeParser, markupParser, tagHelperDescriptorResolver, GetDefaultRewriters(markupParser)) { }
private RazorParser(ParserBase codeParser, ParserBase markupParser, ITagHelperDescriptorResolver tagHelperDescriptorResolver, IEnumerable<ISyntaxTreeRewriter> optimizers) { CodeParser = codeParser; MarkupParser = markupParser; TagHelperDescriptorResolver = tagHelperDescriptorResolver; Optimizers = optimizers.ToList(); }
/// <summary> /// Initializes a new instance of <see cref="MvcRazorHost"/> using the specified <paramref name="chunkTreeCache"/>. /// </summary> /// <param name="chunkTreeCache">An <see cref="IChunkTreeCache"/> rooted at the application base path.</param> /// <param name="resolver">The <see cref="ITagHelperDescriptorResolver"/> used to resolve tag helpers on razor views.</param> public ShapeRazorHost(IChunkTreeCache chunkTreeCache, IHttpContextAccessor httpContextAccessor, ITagHelperDescriptorResolver resolver) : base(chunkTreeCache, resolver) { // We need to resolve the services using the scoped service provider // explicitly as IRazorViewEngine which is resolving IMvcRazorHost is // itself coming from the root service provider. // It's fine in this context as the TagHelperMvcRazorHost registration is Transient // which means we are not keeping any reference on IShapeTableManager and IThemeManager TagHelperDescriptorResolver = new ShapeTagHelperDescriptorResolver( new TagHelperTypeResolver(), new TagHelperDescriptorFactory(designTime: false), httpContextAccessor ); }
public TagHelperDirectiveSpanVisitor( ITagHelperDescriptorResolver descriptorResolver, ErrorSink errorSink) { if (descriptorResolver == null) { throw new ArgumentNullException(nameof(descriptorResolver)); } if (errorSink == null) { throw new ArgumentNullException(nameof(errorSink)); } _descriptorResolver = descriptorResolver; _errorSink = errorSink; }
/// <summary> /// Initializes a new instance of <see cref="RazorParser"/>. /// </summary> /// <param name="codeParser">The <see cref="ParserBase"/> used for parsing code content.</param> /// <param name="markupParser">The <see cref="ParserBase"/> used for parsing markup content.</param> /// <param name="tagHelperDescriptorResolver">The <see cref="ITagHelperDescriptorResolver"/> used to resolve /// <see cref="TagHelperDescriptor"/>s.</param> public RazorParser(ParserBase codeParser, ParserBase markupParser, ITagHelperDescriptorResolver tagHelperDescriptorResolver) : this(codeParser, markupParser, tagHelperDescriptorResolver, GetDefaultRewriters(markupParser)) { if (codeParser == null) { throw new ArgumentNullException(nameof(codeParser)); } if (markupParser == null) { throw new ArgumentNullException(nameof(markupParser)); } }
public GlobalImportTagHelperDirectiveSpanVisitor( ITagHelperDescriptorResolver descriptorResolver, IEnumerable<TagHelperDirectiveDescriptor> globalImportDirectiveDescriptors, ParserErrorSink errorSink) : base(descriptorResolver, errorSink) { _globalImportDirectiveDescriptors = globalImportDirectiveDescriptors; }
public PreMinifyingMvcRazorHost(IChunkTreeCache chunkTreeCache, ITagHelperDescriptorResolver descriptorResolver) { _host = new MvcRazorHost(chunkTreeCache, descriptorResolver); }
// Internal for testing use internal TagHelperDirectiveSpanVisitor(ITagHelperDescriptorResolver descriptorResolver) : this(descriptorResolver, new ErrorSink()) { }
public ViewImportsTagHelperDirectiveSpanVisitor( ITagHelperDescriptorResolver descriptorResolver, IEnumerable<TagHelperDirectiveDescriptor> viewImportsDirectiveDescriptors, ErrorSink errorSink) : base(descriptorResolver, errorSink) { _viewImportsDirectiveDescriptors = viewImportsDirectiveDescriptors; }
/// <summary> /// Initializes a new instance of <see cref="MvcRazorHost"/> using the specified <paramref name="chunkTreeCache"/>. /// </summary> /// <param name="chunkTreeCache">An <see cref="IChunkTreeCache"/> rooted at the application base path.</param> /// <param name="resolver">The <see cref="ITagHelperDescriptorResolver"/> used to resolve tag helpers on razor views.</param> public MvcRazorHost(IChunkTreeCache chunkTreeCache, ITagHelperDescriptorResolver resolver) : this(chunkTreeCache, new RazorPathNormalizer()) { TagHelperDescriptorResolver = resolver; }
public TagHelperFeature(ITagHelperDescriptorResolver resolver) { Resolver = resolver; }
public RazorHost(NamespaceCollection namespaces, IChunkTreeCache chunkTreeCache, ITagHelperDescriptorResolver resolver, IBasePageTypeProvider basePageTypeProvider) : base(chunkTreeCache, resolver) { // Remove the backtick from generic class names string baseClassName = basePageTypeProvider.BasePageType.FullName; int tickIndex = baseClassName.IndexOf('`'); if (tickIndex > 0) { baseClassName = baseClassName.Substring(0, tickIndex); } DefaultBaseClass = basePageTypeProvider.BasePageType.IsGenericTypeDefinition ? $"{baseClassName}<{ChunkHelper.TModelToken}>" : baseClassName; DefaultInheritedChunks.OfType <SetBaseTypeChunk>().First().TypeName = DefaultBaseClass; // The chunk is actually what injects the base name into the view EnableInstrumentation = false; // Add additional default namespaces from the execution context foreach (string ns in namespaces) { NamespaceImports.Add(ns); } }
/// <summary> /// Initializes a new instance of <see cref="MvcRazorHost"/> using the specified <paramref name="chunkTreeCache"/>. /// </summary> /// <param name="chunkTreeCache">An <see cref="IChunkTreeCache"/> rooted at the application base path.</param> /// <param name="resolver">The <see cref="ITagHelperDescriptorResolver"/> used to resolve tag helpers on razor views.</param> public MvcRazorHost(IChunkTreeCache chunkTreeCache, ITagHelperDescriptorResolver resolver) : base(chunkTreeCache, resolver) { }