Expose `IsTagHelper` as an extensibility point.
- This is required for the Razor tooling that determines `TagHelperDescriptor`s. https://github.com/aspnet/RazorTooling/issues/43
This commit is contained in:
parent
18909506e1
commit
f78c52a216
|
|
@ -83,9 +83,19 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
|
||||||
return assembly.ExportedTypes.Select(type => type.GetTypeInfo());
|
return assembly.ExportedTypes.Select(type => type.GetTypeInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Internal for testing.
|
/// <summary>
|
||||||
internal virtual bool IsTagHelper(TypeInfo typeInfo)
|
/// Indicates if a <see cref="TypeInfo"/> should be treated as a tag helper.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="typeInfo">The <see cref="TypeInfo"/> to inspect.</param>
|
||||||
|
/// <returns><c>true</c> if <paramref name="typeInfo"/> should be treated as a tag helper;
|
||||||
|
/// <c>false</c> otherwise</returns>
|
||||||
|
protected virtual bool IsTagHelper(TypeInfo typeInfo)
|
||||||
{
|
{
|
||||||
|
if (typeInfo == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(typeInfo));
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
!typeInfo.IsNested &&
|
!typeInfo.IsNested &&
|
||||||
typeInfo.IsPublic &&
|
typeInfo.IsPublic &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue