Update naming and branding for components

\n\nCommit migrated from f820894941
This commit is contained in:
Ryan Nowak 2019-02-25 15:06:29 -08:00
parent 8f76b90585
commit 6274d4ec86
17 changed files with 213 additions and 213 deletions

View File

@ -1,87 +0,0 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.AspNetCore.Razor.Language.Components
{
// Metadata used for Blazor's interactions with the tag helper system
internal static class BlazorMetadata
{
// There's a bug in the 15.7 preview 1 Razor that prevents 'Kind' from being serialized
// this affects both tooling and build. For now our workaround is to ignore 'Kind' and
// use our own metadata entry to denote non-Component tag helpers.
public static readonly string SpecialKindKey = "Blazor.IsSpecialKind";
public static class Bind
{
public static readonly string RuntimeName = "Blazor.None";
public readonly static string TagHelperKind = "Blazor.Bind";
public readonly static string FallbackKey = "Blazor.Bind.Fallback";
public readonly static string TypeAttribute = "Blazor.Bind.TypeAttribute";
public readonly static string ValueAttribute = "Blazor.Bind.ValueAttribute";
public readonly static string ChangeAttribute = "Blazor.Bind.ChangeAttribute";
public readonly static string ExpressionAttribute = "Blazor.Bind.ExpressionAttribute";
}
public static class ChildContent
{
public static readonly string RuntimeName = "Blazor.None";
public static readonly string TagHelperKind = "Blazor.ChildContent";
public static readonly string ParameterNameBoundAttributeKind = "Blazor.ChildContentParameterName";
/// <summary>
/// The name of the synthesized attribute used to set a child content parameter.
/// </summary>
public static readonly string ParameterAttributeName = "Context";
/// <summary>
/// The default name of the child content parameter (unless set by a Context attribute).
/// </summary>
public static readonly string DefaultParameterName = "context";
}
public static class Component
{
public static readonly string ChildContentKey = "Blazor.ChildContent";
public static readonly string ChildContentParameterNameKey = "Blazor.ChildContentParameterName";
public static readonly string DelegateSignatureKey = "Blazor.DelegateSignature";
public static readonly string EventCallbackKey = "Blazor.EventCallback";
public static readonly string WeaklyTypedKey = "Blazor.IsWeaklyTyped";
public static readonly string RuntimeName = "Blazor.IComponent";
public readonly static string TagHelperKind = "Blazor.Component";
public readonly static string GenericTypedKey = "Blazor.GenericTyped";
public readonly static string TypeParameterKey = "Blazor.TypeParameter";
}
public static class EventHandler
{
public static readonly string EventArgsType = "Blazor.EventHandler.EventArgs";
public static readonly string RuntimeName = "Blazor.None";
public readonly static string TagHelperKind = "Blazor.EventHandler";
}
public static class Ref
{
public readonly static string TagHelperKind = "Blazor.Ref";
public static readonly string RuntimeName = "Blazor.None";
}
}
}

View File

@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Razor.Language.Intermediate;
namespace Microsoft.AspNetCore.Razor.Language.Components
{
// We don't support 'complex' content for components (mixed C# and markup) right now.
// It's not clear yet if Blazor will have a good scenario to use these constructs.
// It's not clear yet if components will have a good scenario to use these constructs.
//
// This is where a lot of the complexity in the Razor/TagHelpers model creeps in and we
// might be able to avoid it if these features aren't needed.

View File

@ -284,7 +284,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
// Now we need to insert the type inference node into the tree.
var namespaceNode = documentNode.Children
.OfType<NamespaceDeclarationIntermediateNode>()
.Where(n => n.Annotations.Contains(new KeyValuePair<object, object>(BlazorMetadata.Component.GenericTypedKey, bool.TrueString)))
.Where(n => n.Annotations.Contains(new KeyValuePair<object, object>(ComponentMetadata.Component.GenericTypedKey, bool.TrueString)))
.FirstOrDefault();
if (namespaceNode == null)
{
@ -292,7 +292,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
{
Annotations =
{
{ BlazorMetadata.Component.GenericTypedKey, bool.TrueString },
{ ComponentMetadata.Component.GenericTypedKey, bool.TrueString },
},
Content = @namespace,
};

View File

@ -6,7 +6,7 @@ using System;
namespace Microsoft.AspNetCore.Razor.Language.Components
{
// Much of the following is equivalent to Microsoft.AspNetCore.Mvc.Razor.Extensions's InjectDirective,
// but this one outputs properties annotated for Blazor's property injector, plus it doesn't need to
// but this one outputs properties annotated for Components's property injector, plus it doesn't need to
// support multiple CodeTargets.
internal class ComponentInjectDirective

View File

@ -87,7 +87,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
// because we see the nodes in the wrong order.
foreach (var childContent in component.ChildContents)
{
childContent.ParameterName = childContent.ParameterName ?? component.ChildContentParameterName ?? BlazorMetadata.ChildContent.DefaultParameterName;
childContent.ParameterName = childContent.ParameterName ?? component.ChildContentParameterName ?? ComponentMetadata.ChildContent.DefaultParameterName;
}
return component;

View File

@ -0,0 +1,87 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.AspNetCore.Razor.Language.Components
{
// Metadata used for Components interactions with the tag helper system
internal static class ComponentMetadata
{
// There's a bug in the 15.7 preview 1 Razor that prevents 'Kind' from being serialized
// this affects both tooling and build. For now our workaround is to ignore 'Kind' and
// use our own metadata entry to denote non-Component tag helpers.
public static readonly string SpecialKindKey = "Components.IsSpecialKind";
public static class Bind
{
public static readonly string RuntimeName = "Components.None";
public readonly static string TagHelperKind = "Components.Bind";
public readonly static string FallbackKey = "Components.Bind.Fallback";
public readonly static string TypeAttribute = "Components.Bind.TypeAttribute";
public readonly static string ValueAttribute = "Components.Bind.ValueAttribute";
public readonly static string ChangeAttribute = "Components.Bind.ChangeAttribute";
public readonly static string ExpressionAttribute = "Components.Bind.ExpressionAttribute";
}
public static class ChildContent
{
public static readonly string RuntimeName = "Components.None";
public static readonly string TagHelperKind = "Components.ChildContent";
public static readonly string ParameterNameBoundAttributeKind = "Components.ChildContentParameterName";
/// <summary>
/// The name of the synthesized attribute used to set a child content parameter.
/// </summary>
public static readonly string ParameterAttributeName = "Context";
/// <summary>
/// The default name of the child content parameter (unless set by a Context attribute).
/// </summary>
public static readonly string DefaultParameterName = "context";
}
public static class Component
{
public static readonly string ChildContentKey = "Components.ChildContent";
public static readonly string ChildContentParameterNameKey = "Components.ChildContentParameterName";
public static readonly string DelegateSignatureKey = "Components.DelegateSignature";
public static readonly string EventCallbackKey = "Components.EventCallback";
public static readonly string WeaklyTypedKey = "Components.IsWeaklyTyped";
public static readonly string RuntimeName = "Components.IComponent";
public readonly static string TagHelperKind = "Components.Component";
public readonly static string GenericTypedKey = "Components.GenericTyped";
public readonly static string TypeParameterKey = "Components.TypeParameter";
}
public static class EventHandler
{
public static readonly string EventArgsType = "Components.EventHandler.EventArgs";
public static readonly string RuntimeName = "Components.None";
public readonly static string TagHelperKind = "Components.EventHandler";
}
public static class Ref
{
public readonly static string TagHelperKind = "Components.Ref";
public static readonly string RuntimeName = "Components.None";
}
}
}

View File

@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(attribute));
}
var key = BlazorMetadata.Component.DelegateSignatureKey;
var key = ComponentMetadata.Component.DelegateSignatureKey;
return
attribute.Metadata.TryGetValue(key, out var value) &&
string.Equals(value, bool.TrueString);
@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(attribute));
}
var key = BlazorMetadata.Component.EventCallbackKey;
var key = ComponentMetadata.Component.EventCallbackKey;
return
attribute.Metadata.TryGetValue(key, out var value) &&
string.Equals(value, bool.TrueString);
@ -47,7 +47,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
}
return
attribute.Metadata.TryGetValue(BlazorMetadata.Component.GenericTypedKey, out var value) &&
attribute.Metadata.TryGetValue(ComponentMetadata.Component.GenericTypedKey, out var value) &&
string.Equals(value, bool.TrueString);
}
@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
}
return
attribute.Metadata.TryGetValue(BlazorMetadata.Component.TypeParameterKey, out var value) &&
attribute.Metadata.TryGetValue(ComponentMetadata.Component.TypeParameterKey, out var value) &&
string.Equals(value, bool.TrueString);
}
@ -70,7 +70,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(attribute));
}
var key = BlazorMetadata.Component.WeaklyTypedKey;
var key = ComponentMetadata.Component.WeaklyTypedKey;
return
attribute.Metadata.TryGetValue(key, out var value) &&
string.Equals(value, bool.TrueString);
@ -89,7 +89,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(attribute));
}
var key = BlazorMetadata.Component.ChildContentKey;
var key = ComponentMetadata.Component.ChildContentKey;
return
attribute.Metadata.TryGetValue(key, out var value) &&
string.Equals(value, bool.TrueString);
@ -108,7 +108,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(attribute));
}
var key = BlazorMetadata.Component.ChildContentKey;
var key = ComponentMetadata.Component.ChildContentKey;
return
attribute.Metadata.TryGetValue(key, out var value) &&
string.Equals(value, bool.TrueString);
@ -164,7 +164,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(attribute));
}
var key = BlazorMetadata.Component.ChildContentParameterNameKey;
var key = ComponentMetadata.Component.ChildContentParameterNameKey;
return
attribute.Metadata.TryGetValue(key, out var value) &&
string.Equals(value, bool.TrueString);

View File

@ -18,8 +18,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
}
return
tagHelper.Metadata.TryGetValue(BlazorMetadata.SpecialKindKey, out var kind) &&
string.Equals(BlazorMetadata.Bind.TagHelperKind, kind);
tagHelper.Metadata.TryGetValue(ComponentMetadata.SpecialKindKey, out var kind) &&
string.Equals(ComponentMetadata.Bind.TagHelperKind, kind);
}
public static bool IsFallbackBindTagHelper(this TagHelperDescriptor tagHelper)
@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
return
tagHelper.IsBindTagHelper() &&
tagHelper.Metadata.TryGetValue(BlazorMetadata.Bind.FallbackKey, out var fallback) &&
tagHelper.Metadata.TryGetValue(ComponentMetadata.Bind.FallbackKey, out var fallback) &&
string.Equals(bool.TrueString, fallback);
}
@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
return
IsComponentTagHelper(tagHelper) &&
tagHelper.Metadata.TryGetValue(BlazorMetadata.Component.GenericTypedKey, out var value) &&
tagHelper.Metadata.TryGetValue(ComponentMetadata.Component.GenericTypedKey, out var value) &&
string.Equals(bool.TrueString, value);
}
@ -70,7 +70,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
return
tagHelper.IsInputElementBindTagHelper() &&
!tagHelper.Metadata.ContainsKey(BlazorMetadata.Bind.TypeAttribute);
!tagHelper.Metadata.ContainsKey(ComponentMetadata.Bind.TypeAttribute);
}
public static string GetValueAttributeName(this TagHelperDescriptor tagHelper)
@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(tagHelper));
}
tagHelper.Metadata.TryGetValue(BlazorMetadata.Bind.ValueAttribute, out var result);
tagHelper.Metadata.TryGetValue(ComponentMetadata.Bind.ValueAttribute, out var result);
return result;
}
@ -91,7 +91,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(tagHelper));
}
tagHelper.Metadata.TryGetValue(BlazorMetadata.Bind.ChangeAttribute, out var result);
tagHelper.Metadata.TryGetValue(ComponentMetadata.Bind.ChangeAttribute, out var result);
return result;
}
@ -102,7 +102,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(tagHelper));
}
tagHelper.Metadata.TryGetValue(BlazorMetadata.Bind.ExpressionAttribute, out var result);
tagHelper.Metadata.TryGetValue(ComponentMetadata.Bind.ExpressionAttribute, out var result);
return result;
}
@ -114,8 +114,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
}
return
tagHelper.Metadata.TryGetValue(BlazorMetadata.SpecialKindKey, out var value) &&
string.Equals(value, BlazorMetadata.ChildContent.TagHelperKind, StringComparison.Ordinal);
tagHelper.Metadata.TryGetValue(ComponentMetadata.SpecialKindKey, out var value) &&
string.Equals(value, ComponentMetadata.ChildContent.TagHelperKind, StringComparison.Ordinal);
}
public static bool IsComponentTagHelper(this TagHelperDescriptor tagHelper)
@ -125,7 +125,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(tagHelper));
}
return !tagHelper.Metadata.ContainsKey(BlazorMetadata.SpecialKindKey);
return !tagHelper.Metadata.ContainsKey(ComponentMetadata.SpecialKindKey);
}
public static bool IsEventHandlerTagHelper(this TagHelperDescriptor tagHelper)
@ -136,8 +136,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
}
return
tagHelper.Metadata.TryGetValue(BlazorMetadata.SpecialKindKey, out var kind) &&
string.Equals(BlazorMetadata.EventHandler.TagHelperKind, kind);
tagHelper.Metadata.TryGetValue(ComponentMetadata.SpecialKindKey, out var kind) &&
string.Equals(ComponentMetadata.EventHandler.TagHelperKind, kind);
}
public static bool IsRefTagHelper(this TagHelperDescriptor tagHelper)
@ -148,8 +148,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
}
return
tagHelper.Metadata.TryGetValue(BlazorMetadata.SpecialKindKey, out var kind) &&
string.Equals(BlazorMetadata.Ref.TagHelperKind, kind);
tagHelper.Metadata.TryGetValue(ComponentMetadata.SpecialKindKey, out var kind) &&
string.Equals(ComponentMetadata.Ref.TagHelperKind, kind);
}
public static string GetEventArgsType(this TagHelperDescriptor tagHelper)
@ -159,7 +159,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(tagHelper));
}
tagHelper.Metadata.TryGetValue(BlazorMetadata.EventHandler.EventArgsType, out var result);
tagHelper.Metadata.TryGetValue(ComponentMetadata.EventHandler.EventArgsType, out var result);
return result;
}

View File

@ -117,13 +117,13 @@ namespace Microsoft.CodeAnalysis.Razor
private TagHelperDescriptor CreateFallbackBindTagHelper()
{
var builder = TagHelperDescriptorBuilder.Create(BlazorMetadata.Bind.TagHelperKind, "Bind", ComponentsApi.AssemblyName);
var builder = TagHelperDescriptorBuilder.Create(ComponentMetadata.Bind.TagHelperKind, "Bind", ComponentsApi.AssemblyName);
builder.Documentation = ComponentResources.BindTagHelper_Fallback_Documentation;
builder.Metadata.Add(BlazorMetadata.SpecialKindKey, BlazorMetadata.Bind.TagHelperKind);
builder.Metadata.Add(ComponentMetadata.SpecialKindKey, ComponentMetadata.Bind.TagHelperKind);
builder.Metadata.Add(TagHelperMetadata.Common.ClassifyAttributesOnly, bool.TrueString);
builder.Metadata[TagHelperMetadata.Runtime.Name] = BlazorMetadata.Bind.RuntimeName;
builder.Metadata[BlazorMetadata.Bind.FallbackKey] = bool.TrueString;
builder.Metadata[TagHelperMetadata.Runtime.Name] = ComponentMetadata.Bind.RuntimeName;
builder.Metadata[ComponentMetadata.Bind.FallbackKey] = bool.TrueString;
// WTE has a bug in 15.7p1 where a Tag Helper without a display-name that looks like
// a C# property will crash trying to create the toolips.
@ -251,17 +251,17 @@ namespace Microsoft.CodeAnalysis.Razor
var formatName = entry.Suffix == null ? "Format_" + entry.ValueAttribute : "Format_" + entry.Suffix;
var formatAttributeName = entry.Suffix == null ? "format-" + entry.ValueAttribute : "format-" + entry.Suffix;
var builder = TagHelperDescriptorBuilder.Create(BlazorMetadata.Bind.TagHelperKind, name, ComponentsApi.AssemblyName);
var builder = TagHelperDescriptorBuilder.Create(ComponentMetadata.Bind.TagHelperKind, name, ComponentsApi.AssemblyName);
builder.Documentation = string.Format(
ComponentResources.BindTagHelper_Element_Documentation,
entry.ValueAttribute,
entry.ChangeAttribute);
builder.Metadata.Add(BlazorMetadata.SpecialKindKey, BlazorMetadata.Bind.TagHelperKind);
builder.Metadata.Add(ComponentMetadata.SpecialKindKey, ComponentMetadata.Bind.TagHelperKind);
builder.Metadata.Add(TagHelperMetadata.Common.ClassifyAttributesOnly, bool.TrueString);
builder.Metadata[TagHelperMetadata.Runtime.Name] = BlazorMetadata.Bind.RuntimeName;
builder.Metadata[BlazorMetadata.Bind.ValueAttribute] = entry.ValueAttribute;
builder.Metadata[BlazorMetadata.Bind.ChangeAttribute] = entry.ChangeAttribute;
builder.Metadata[TagHelperMetadata.Runtime.Name] = ComponentMetadata.Bind.RuntimeName;
builder.Metadata[ComponentMetadata.Bind.ValueAttribute] = entry.ValueAttribute;
builder.Metadata[ComponentMetadata.Bind.ChangeAttribute] = entry.ChangeAttribute;
if (entry.TypeAttribute != null)
{
@ -274,7 +274,7 @@ namespace Microsoft.CodeAnalysis.Razor
//
// Therefore we use this metadata to know which one is more specific when two
// tag helpers match.
builder.Metadata[BlazorMetadata.Bind.TypeAttribute] = entry.TypeAttribute;
builder.Metadata[ComponentMetadata.Bind.TypeAttribute] = entry.TypeAttribute;
}
// WTE has a bug in 15.7p1 where a Tag Helper without a display-name that looks like
@ -397,21 +397,21 @@ namespace Microsoft.CodeAnalysis.Razor
continue;
}
var builder = TagHelperDescriptorBuilder.Create(BlazorMetadata.Bind.TagHelperKind, tagHelper.Name, tagHelper.AssemblyName);
var builder = TagHelperDescriptorBuilder.Create(ComponentMetadata.Bind.TagHelperKind, tagHelper.Name, tagHelper.AssemblyName);
builder.DisplayName = tagHelper.DisplayName;
builder.Documentation = string.Format(
ComponentResources.BindTagHelper_Component_Documentation,
valueAttribute.Name,
changeAttribute.Name);
builder.Metadata.Add(BlazorMetadata.SpecialKindKey, BlazorMetadata.Bind.TagHelperKind);
builder.Metadata[TagHelperMetadata.Runtime.Name] = BlazorMetadata.Bind.RuntimeName;
builder.Metadata[BlazorMetadata.Bind.ValueAttribute] = valueAttribute.Name;
builder.Metadata[BlazorMetadata.Bind.ChangeAttribute] = changeAttribute.Name;
builder.Metadata.Add(ComponentMetadata.SpecialKindKey, ComponentMetadata.Bind.TagHelperKind);
builder.Metadata[TagHelperMetadata.Runtime.Name] = ComponentMetadata.Bind.RuntimeName;
builder.Metadata[ComponentMetadata.Bind.ValueAttribute] = valueAttribute.Name;
builder.Metadata[ComponentMetadata.Bind.ChangeAttribute] = changeAttribute.Name;
if (expressionAttribute != null)
{
builder.Metadata[BlazorMetadata.Bind.ExpressionAttribute] = expressionAttribute.Name;
builder.Metadata[ComponentMetadata.Bind.ExpressionAttribute] = expressionAttribute.Name;
}
// WTE has a bug 15.7p1 where a Tag Helper without a display-name that looks like

View File

@ -86,16 +86,16 @@ namespace Microsoft.CodeAnalysis.Razor
var typeName = type.ToDisplayString(FullNameTypeDisplayFormat);
var assemblyName = type.ContainingAssembly.Identity.Name;
var builder = TagHelperDescriptorBuilder.Create(BlazorMetadata.Component.TagHelperKind, typeName, assemblyName);
var builder = TagHelperDescriptorBuilder.Create(ComponentMetadata.Component.TagHelperKind, typeName, assemblyName);
builder.SetTypeName(typeName);
// This opts out this 'component' tag helper for any processing that's specific to the default
// Razor ITagHelper runtime.
builder.Metadata[TagHelperMetadata.Runtime.Name] = BlazorMetadata.Component.RuntimeName;
builder.Metadata[TagHelperMetadata.Runtime.Name] = ComponentMetadata.Component.RuntimeName;
if (type.IsGenericType)
{
builder.Metadata[BlazorMetadata.Component.GenericTypedKey] = bool.TrueString;
builder.Metadata[ComponentMetadata.Component.GenericTypedKey] = bool.TrueString;
for (var i = 0; i < type.TypeArguments.Length; i++)
{
@ -127,7 +127,7 @@ namespace Microsoft.CodeAnalysis.Razor
}
if (builder.BoundAttributes.Any(a => a.IsParameterizedChildContentProperty()) &&
!builder.BoundAttributes.Any(a => string.Equals(a.Name, BlazorMetadata.ChildContent.ParameterAttributeName, StringComparison.OrdinalIgnoreCase)))
!builder.BoundAttributes.Any(a => string.Equals(a.Name, ComponentMetadata.ChildContent.ParameterAttributeName, StringComparison.OrdinalIgnoreCase)))
{
// If we have any parameterized child content parameters, synthesize a 'Context' parameter to be
// able to set the variable name (for all child content). If the developer defined a 'Context' parameter
@ -154,22 +154,22 @@ namespace Microsoft.CodeAnalysis.Razor
if (kind == PropertyKind.ChildContent)
{
pb.Metadata.Add(BlazorMetadata.Component.ChildContentKey, bool.TrueString);
pb.Metadata.Add(ComponentMetadata.Component.ChildContentKey, bool.TrueString);
}
if (kind == PropertyKind.EventCallback)
{
pb.Metadata.Add(BlazorMetadata.Component.EventCallbackKey, bool.TrueString);
pb.Metadata.Add(ComponentMetadata.Component.EventCallbackKey, bool.TrueString);
}
if (kind == PropertyKind.Delegate)
{
pb.Metadata.Add(BlazorMetadata.Component.DelegateSignatureKey, bool.TrueString);
pb.Metadata.Add(ComponentMetadata.Component.DelegateSignatureKey, bool.TrueString);
}
if (HasTypeParameter(property.Type))
{
pb.Metadata.Add(BlazorMetadata.Component.GenericTypedKey, bool.TrueString);
pb.Metadata.Add(ComponentMetadata.Component.GenericTypedKey, bool.TrueString);
}
var xml = property.GetDocumentationCommentXml();
@ -229,7 +229,7 @@ namespace Microsoft.CodeAnalysis.Razor
pb.TypeName = typeof(Type).FullName;
pb.SetPropertyName(typeParameter.Name);
pb.Metadata[BlazorMetadata.Component.TypeParameterKey] = bool.TrueString;
pb.Metadata[ComponentMetadata.Component.TypeParameterKey] = bool.TrueString;
pb.Documentation = string.Format(ComponentResources.ComponentTypeParameter_Documentation, typeParameter.Name, builder.Name);
});
@ -240,15 +240,15 @@ namespace Microsoft.CodeAnalysis.Razor
var typeName = component.GetTypeName() + "." + attribute.Name;
var assemblyName = component.AssemblyName;
var builder = TagHelperDescriptorBuilder.Create(BlazorMetadata.ChildContent.TagHelperKind, typeName, assemblyName);
var builder = TagHelperDescriptorBuilder.Create(ComponentMetadata.ChildContent.TagHelperKind, typeName, assemblyName);
builder.SetTypeName(typeName);
// This opts out this 'component' tag helper for any processing that's specific to the default
// Razor ITagHelper runtime.
builder.Metadata[TagHelperMetadata.Runtime.Name] = BlazorMetadata.ChildContent.RuntimeName;
builder.Metadata[TagHelperMetadata.Runtime.Name] = ComponentMetadata.ChildContent.RuntimeName;
// Opt out of processing as a component. We'll process this specially as part of the component's body.
builder.Metadata[BlazorMetadata.SpecialKindKey] = BlazorMetadata.ChildContent.TagHelperKind;
builder.Metadata[ComponentMetadata.SpecialKindKey] = ComponentMetadata.ChildContent.TagHelperKind;
var xml = attribute.Documentation;
if (!string.IsNullOrEmpty(xml))
@ -279,9 +279,9 @@ namespace Microsoft.CodeAnalysis.Razor
{
builder.BindAttribute(b =>
{
b.Name = BlazorMetadata.ChildContent.ParameterAttributeName;
b.Name = ComponentMetadata.ChildContent.ParameterAttributeName;
b.TypeName = typeof(string).FullName;
b.Metadata.Add(BlazorMetadata.Component.ChildContentParameterNameKey, bool.TrueString);
b.Metadata.Add(ComponentMetadata.Component.ChildContentParameterNameKey, bool.TrueString);
if (childContentName == null)
{

View File

@ -103,16 +103,16 @@ namespace Microsoft.CodeAnalysis.Razor
{
var entry = data[i];
var builder = TagHelperDescriptorBuilder.Create(BlazorMetadata.EventHandler.TagHelperKind, entry.Attribute, ComponentsApi.AssemblyName);
var builder = TagHelperDescriptorBuilder.Create(ComponentMetadata.EventHandler.TagHelperKind, entry.Attribute, ComponentsApi.AssemblyName);
builder.Documentation = string.Format(
ComponentResources.EventHandlerTagHelper_Documentation,
entry.Attribute,
entry.EventArgsType.ToDisplayString());
builder.Metadata.Add(BlazorMetadata.SpecialKindKey, BlazorMetadata.EventHandler.TagHelperKind);
builder.Metadata.Add(BlazorMetadata.EventHandler.EventArgsType, entry.EventArgsType.ToDisplayString());
builder.Metadata.Add(ComponentMetadata.SpecialKindKey, ComponentMetadata.EventHandler.TagHelperKind);
builder.Metadata.Add(ComponentMetadata.EventHandler.EventArgsType, entry.EventArgsType.ToDisplayString());
builder.Metadata.Add(TagHelperMetadata.Common.ClassifyAttributesOnly, bool.TrueString);
builder.Metadata[TagHelperMetadata.Runtime.Name] = BlazorMetadata.EventHandler.RuntimeName;
builder.Metadata[TagHelperMetadata.Runtime.Name] = ComponentMetadata.EventHandler.RuntimeName;
// WTE has a bug in 15.7p1 where a Tag Helper without a display-name that looks like
// a C# property will crash trying to create the tooltips.
@ -143,7 +143,7 @@ namespace Microsoft.CodeAnalysis.Razor
// But make this weakly typed (don't type check) - delegates have their own type-checking
// logic that we don't want to interfere with.
a.Metadata.Add(BlazorMetadata.Component.WeaklyTypedKey, bool.TrueString);
a.Metadata.Add(ComponentMetadata.Component.WeaklyTypedKey, bool.TrueString);
// WTE has a bug 15.7p1 where a Tag Helper without a display-name that looks like
// a C# property will crash trying to create the tooltips.

View File

@ -40,12 +40,12 @@ namespace Microsoft.CodeAnalysis.Razor
private TagHelperDescriptor CreateRefTagHelper()
{
var builder = TagHelperDescriptorBuilder.Create(BlazorMetadata.Ref.TagHelperKind, "Ref", ComponentsApi.AssemblyName);
var builder = TagHelperDescriptorBuilder.Create(ComponentMetadata.Ref.TagHelperKind, "Ref", ComponentsApi.AssemblyName);
builder.Documentation = ComponentResources.RefTagHelper_Documentation;
builder.Metadata.Add(BlazorMetadata.SpecialKindKey, BlazorMetadata.Ref.TagHelperKind);
builder.Metadata.Add(ComponentMetadata.SpecialKindKey, ComponentMetadata.Ref.TagHelperKind);
builder.Metadata.Add(TagHelperMetadata.Common.ClassifyAttributesOnly, bool.TrueString);
builder.Metadata[TagHelperMetadata.Runtime.Name] = BlazorMetadata.Ref.RuntimeName;
builder.Metadata[TagHelperMetadata.Runtime.Name] = ComponentMetadata.Ref.RuntimeName;
// WTE has a bug in 15.7p1 where a Tag Helper without a display-name that looks like
// a C# property will crash trying to create the tooltips.

View File

@ -66,14 +66,14 @@ namespace Test
// here and then ignoring them.
Assert.Empty(bind.Diagnostics);
Assert.False(bind.HasErrors);
Assert.Equal(BlazorMetadata.Bind.TagHelperKind, bind.Kind);
Assert.Equal(BlazorMetadata.Bind.RuntimeName, bind.Metadata[TagHelperMetadata.Runtime.Name]);
Assert.Equal(ComponentMetadata.Bind.TagHelperKind, bind.Kind);
Assert.Equal(ComponentMetadata.Bind.RuntimeName, bind.Metadata[TagHelperMetadata.Runtime.Name]);
Assert.False(bind.IsDefaultKind());
Assert.False(bind.KindUsesDefaultTagHelperRuntime());
Assert.Equal("MyProperty", bind.Metadata[BlazorMetadata.Bind.ValueAttribute]);
Assert.Equal("MyPropertyChanged", bind.Metadata[BlazorMetadata.Bind.ChangeAttribute]);
Assert.Equal("MyPropertyExpression", bind.Metadata[BlazorMetadata.Bind.ExpressionAttribute]);
Assert.Equal("MyProperty", bind.Metadata[ComponentMetadata.Bind.ValueAttribute]);
Assert.Equal("MyPropertyChanged", bind.Metadata[ComponentMetadata.Bind.ChangeAttribute]);
Assert.Equal("MyPropertyExpression", bind.Metadata[ComponentMetadata.Bind.ExpressionAttribute]);
Assert.Equal(
"Binds the provided expression to the 'MyProperty' property and a change event " +
@ -106,7 +106,7 @@ namespace Test
// Invariants
Assert.Empty(attribute.Diagnostics);
Assert.False(attribute.HasErrors);
Assert.Equal(BlazorMetadata.Bind.TagHelperKind, attribute.Kind);
Assert.Equal(ComponentMetadata.Bind.TagHelperKind, attribute.Kind);
Assert.False(attribute.IsDefaultKind());
Assert.False(attribute.HasIndexer);
Assert.Null(attribute.IndexerNamePrefix);
@ -181,13 +181,13 @@ namespace Test
// here and then ignoring them.
Assert.Empty(bind.Diagnostics);
Assert.False(bind.HasErrors);
Assert.Equal(BlazorMetadata.Bind.TagHelperKind, bind.Kind);
Assert.Equal(BlazorMetadata.Bind.RuntimeName, bind.Metadata[TagHelperMetadata.Runtime.Name]);
Assert.Equal(ComponentMetadata.Bind.TagHelperKind, bind.Kind);
Assert.Equal(ComponentMetadata.Bind.RuntimeName, bind.Metadata[TagHelperMetadata.Runtime.Name]);
Assert.False(bind.IsDefaultKind());
Assert.False(bind.KindUsesDefaultTagHelperRuntime());
Assert.Equal("MyProperty", bind.Metadata[BlazorMetadata.Bind.ValueAttribute]);
Assert.Equal("MyPropertyChanged", bind.Metadata[BlazorMetadata.Bind.ChangeAttribute]);
Assert.Equal("MyProperty", bind.Metadata[ComponentMetadata.Bind.ValueAttribute]);
Assert.Equal("MyPropertyChanged", bind.Metadata[ComponentMetadata.Bind.ChangeAttribute]);
Assert.Equal(
"Binds the provided expression to the 'MyProperty' property and a change event " +
@ -220,7 +220,7 @@ namespace Test
// Invariants
Assert.Empty(attribute.Diagnostics);
Assert.False(attribute.HasErrors);
Assert.Equal(BlazorMetadata.Bind.TagHelperKind, attribute.Kind);
Assert.Equal(ComponentMetadata.Bind.TagHelperKind, attribute.Kind);
Assert.False(attribute.IsDefaultKind());
Assert.False(attribute.HasIndexer);
Assert.Null(attribute.IndexerNamePrefix);
@ -325,14 +325,14 @@ namespace Test
// here and then ignoring them.
Assert.Empty(bind.Diagnostics);
Assert.False(bind.HasErrors);
Assert.Equal(BlazorMetadata.Bind.TagHelperKind, bind.Kind);
Assert.Equal(ComponentMetadata.Bind.TagHelperKind, bind.Kind);
Assert.Equal(bool.TrueString, bind.Metadata[TagHelperMetadata.Common.ClassifyAttributesOnly]);
Assert.Equal(BlazorMetadata.Bind.RuntimeName, bind.Metadata[TagHelperMetadata.Runtime.Name]);
Assert.Equal(ComponentMetadata.Bind.RuntimeName, bind.Metadata[TagHelperMetadata.Runtime.Name]);
Assert.False(bind.IsDefaultKind());
Assert.False(bind.KindUsesDefaultTagHelperRuntime());
Assert.Equal("myprop", bind.Metadata[BlazorMetadata.Bind.ValueAttribute]);
Assert.Equal("myevent", bind.Metadata[BlazorMetadata.Bind.ChangeAttribute]);
Assert.Equal("myprop", bind.Metadata[ComponentMetadata.Bind.ValueAttribute]);
Assert.Equal("myevent", bind.Metadata[ComponentMetadata.Bind.ChangeAttribute]);
Assert.False(bind.IsInputElementBindTagHelper());
Assert.False(bind.IsInputElementFallbackBindTagHelper());
@ -368,7 +368,7 @@ namespace Test
// Invariants
Assert.Empty(attribute.Diagnostics);
Assert.False(attribute.HasErrors);
Assert.Equal(BlazorMetadata.Bind.TagHelperKind, attribute.Kind);
Assert.Equal(ComponentMetadata.Bind.TagHelperKind, attribute.Kind);
Assert.False(attribute.IsDefaultKind());
Assert.False(attribute.HasIndexer);
Assert.Null(attribute.IndexerNamePrefix);
@ -396,7 +396,7 @@ namespace Test
// Invariants
Assert.Empty(attribute.Diagnostics);
Assert.False(attribute.HasErrors);
Assert.Equal(BlazorMetadata.Bind.TagHelperKind, attribute.Kind);
Assert.Equal(ComponentMetadata.Bind.TagHelperKind, attribute.Kind);
Assert.False(attribute.IsDefaultKind());
Assert.False(attribute.HasIndexer);
Assert.Null(attribute.IndexerNamePrefix);
@ -450,8 +450,8 @@ namespace Test
var matches = GetBindTagHelpers(context);
var bind = Assert.Single(matches);
Assert.Equal("myprop", bind.Metadata[BlazorMetadata.Bind.ValueAttribute]);
Assert.Equal("myevent", bind.Metadata[BlazorMetadata.Bind.ChangeAttribute]);
Assert.Equal("myprop", bind.Metadata[ComponentMetadata.Bind.ValueAttribute]);
Assert.Equal("myevent", bind.Metadata[ComponentMetadata.Bind.ChangeAttribute]);
Assert.False(bind.IsInputElementBindTagHelper());
Assert.False(bind.IsInputElementFallbackBindTagHelper());
@ -504,9 +504,9 @@ namespace Test
var matches = GetBindTagHelpers(context);
var bind = Assert.Single(matches);
Assert.Equal("myprop", bind.Metadata[BlazorMetadata.Bind.ValueAttribute]);
Assert.Equal("myevent", bind.Metadata[BlazorMetadata.Bind.ChangeAttribute]);
Assert.False(bind.Metadata.ContainsKey(BlazorMetadata.Bind.TypeAttribute));
Assert.Equal("myprop", bind.Metadata[ComponentMetadata.Bind.ValueAttribute]);
Assert.Equal("myevent", bind.Metadata[ComponentMetadata.Bind.ChangeAttribute]);
Assert.False(bind.Metadata.ContainsKey(ComponentMetadata.Bind.TypeAttribute));
Assert.True(bind.IsInputElementBindTagHelper());
Assert.True(bind.IsInputElementFallbackBindTagHelper());
@ -559,9 +559,9 @@ namespace Test
var matches = GetBindTagHelpers(context);
var bind = Assert.Single(matches);
Assert.Equal("myprop", bind.Metadata[BlazorMetadata.Bind.ValueAttribute]);
Assert.Equal("myevent", bind.Metadata[BlazorMetadata.Bind.ChangeAttribute]);
Assert.Equal("checkbox", bind.Metadata[BlazorMetadata.Bind.TypeAttribute]);
Assert.Equal("myprop", bind.Metadata[ComponentMetadata.Bind.ValueAttribute]);
Assert.Equal("myevent", bind.Metadata[ComponentMetadata.Bind.ChangeAttribute]);
Assert.Equal("checkbox", bind.Metadata[ComponentMetadata.Bind.TypeAttribute]);
Assert.True(bind.IsInputElementBindTagHelper());
Assert.False(bind.IsInputElementFallbackBindTagHelper());
@ -626,9 +626,9 @@ namespace Test
var matches = GetBindTagHelpers(context);
var bind = Assert.Single(matches);
Assert.Equal("myprop", bind.Metadata[BlazorMetadata.Bind.ValueAttribute]);
Assert.Equal("myevent", bind.Metadata[BlazorMetadata.Bind.ChangeAttribute]);
Assert.Equal("checkbox", bind.Metadata[BlazorMetadata.Bind.TypeAttribute]);
Assert.Equal("myprop", bind.Metadata[ComponentMetadata.Bind.ValueAttribute]);
Assert.Equal("myevent", bind.Metadata[ComponentMetadata.Bind.ChangeAttribute]);
Assert.Equal("checkbox", bind.Metadata[ComponentMetadata.Bind.TypeAttribute]);
Assert.True(bind.IsInputElementBindTagHelper());
Assert.False(bind.IsInputElementFallbackBindTagHelper());
@ -690,14 +690,14 @@ namespace Test
// here and then ignoring them.
Assert.Empty(bind.Diagnostics);
Assert.False(bind.HasErrors);
Assert.Equal(BlazorMetadata.Bind.TagHelperKind, bind.Kind);
Assert.Equal(ComponentMetadata.Bind.TagHelperKind, bind.Kind);
Assert.Equal(bool.TrueString, bind.Metadata[TagHelperMetadata.Common.ClassifyAttributesOnly]);
Assert.Equal(BlazorMetadata.Bind.RuntimeName, bind.Metadata[TagHelperMetadata.Runtime.Name]);
Assert.Equal(ComponentMetadata.Bind.RuntimeName, bind.Metadata[TagHelperMetadata.Runtime.Name]);
Assert.False(bind.IsDefaultKind());
Assert.False(bind.KindUsesDefaultTagHelperRuntime());
Assert.False(bind.Metadata.ContainsKey(BlazorMetadata.Bind.ValueAttribute));
Assert.False(bind.Metadata.ContainsKey(BlazorMetadata.Bind.ChangeAttribute));
Assert.False(bind.Metadata.ContainsKey(ComponentMetadata.Bind.ValueAttribute));
Assert.False(bind.Metadata.ContainsKey(ComponentMetadata.Bind.ChangeAttribute));
Assert.True(bind.IsFallbackBindTagHelper());
Assert.Equal(
@ -734,7 +734,7 @@ namespace Test
// Invariants
Assert.Empty(attribute.Diagnostics);
Assert.False(attribute.HasErrors);
Assert.Equal(BlazorMetadata.Bind.TagHelperKind, attribute.Kind);
Assert.Equal(ComponentMetadata.Bind.TagHelperKind, attribute.Kind);
Assert.False(attribute.IsDefaultKind());
Assert.False(attribute.IsIndexerBooleanProperty);
Assert.False(attribute.IsIndexerStringProperty);
@ -767,7 +767,7 @@ namespace Test
// Invariants
Assert.Empty(attribute.Diagnostics);
Assert.False(attribute.HasErrors);
Assert.Equal(BlazorMetadata.Bind.TagHelperKind, attribute.Kind);
Assert.Equal(ComponentMetadata.Bind.TagHelperKind, attribute.Kind);
Assert.False(attribute.IsDefaultKind());
Assert.True(attribute.HasIndexer);
Assert.Equal("format-", attribute.IndexerNamePrefix);

View File

@ -56,7 +56,7 @@ namespace Test
// here and then ignoring them.
Assert.Empty(component.Diagnostics);
Assert.False(component.HasErrors);
Assert.Equal(BlazorMetadata.Component.TagHelperKind, component.Kind);
Assert.Equal(ComponentMetadata.Component.TagHelperKind, component.Kind);
Assert.False(component.IsDefaultKind());
Assert.False(component.KindUsesDefaultTagHelperRuntime());
@ -84,7 +84,7 @@ namespace Test
Assert.Collection(
component.Metadata.OrderBy(kvp => kvp.Key),
kvp => { Assert.Equal(TagHelperMetadata.Common.TypeName, kvp.Key); Assert.Equal("Test.MyComponent", kvp.Value); },
kvp => { Assert.Equal(TagHelperMetadata.Runtime.Name, kvp.Key); Assert.Equal("Blazor.IComponent", kvp.Value); });
kvp => { Assert.Equal(TagHelperMetadata.Runtime.Name, kvp.Key); Assert.Equal("Components.IComponent", kvp.Value); });
// Our use of bound attributes is what tests will focus on. As you might expect right now, this test
// is going to cover a lot of trivial stuff that will be true for all components/component-properties.
@ -93,7 +93,7 @@ namespace Test
// Invariants
Assert.Empty(attribute.Diagnostics);
Assert.False(attribute.HasErrors);
Assert.Equal("Blazor.Component", attribute.Kind);
Assert.Equal("Components.Component", attribute.Kind);
Assert.False(attribute.IsDefaultKind());
// Related to dictionaries/indexers, not supported currently, not sure if we ever will
@ -852,7 +852,7 @@ namespace Test
},
a =>
{
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.True(a.IsChildContentParameterNameProperty());
});
@ -863,7 +863,7 @@ namespace Test
// A RenderFragment<T> tag helper has a parameter to allow you to set the lambda parameter name.
var contextAttribute = Assert.Single(childContent.BoundAttributes);
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, contextAttribute.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, contextAttribute.Name);
Assert.Equal("System.String", contextAttribute.TypeName);
Assert.Equal("Specifies the parameter name for the 'ChildContent2' child content expression.", contextAttribute.Documentation);
Assert.True(contextAttribute.IsChildContentParameterNameProperty());
@ -926,7 +926,7 @@ namespace Test
},
a =>
{
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.False(a.IsChildContentParameterNameProperty());
});
@ -937,7 +937,7 @@ namespace Test
// A RenderFragment<T> tag helper has a parameter to allow you to set the lambda parameter name.
var contextAttribute = Assert.Single(childContent.BoundAttributes);
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, contextAttribute.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, contextAttribute.Name);
Assert.Equal("System.String", contextAttribute.TypeName);
Assert.Equal("Specifies the parameter name for the 'ChildContent2' child content expression.", contextAttribute.Documentation);
Assert.True(contextAttribute.IsChildContentParameterNameProperty());
@ -998,7 +998,7 @@ namespace Test
},
a =>
{
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.True(a.IsChildContentParameterNameProperty());
},
a =>
@ -1017,7 +1017,7 @@ namespace Test
// A RenderFragment<T> tag helper has a parameter to allow you to set the lambda parameter name.
var contextAttribute = Assert.Single(childContent.BoundAttributes);
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, contextAttribute.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, contextAttribute.Name);
Assert.Equal("System.String", contextAttribute.TypeName);
Assert.Equal("Specifies the parameter name for the 'ChildContent2' child content expression.", contextAttribute.Documentation);
Assert.True(contextAttribute.IsChildContentParameterNameProperty());
@ -1079,7 +1079,7 @@ namespace Test
},
a =>
{
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.True(a.IsChildContentParameterNameProperty());
},
a =>
@ -1098,7 +1098,7 @@ namespace Test
// A RenderFragment<T> tag helper has a parameter to allow you to set the lambda parameter name.
var contextAttribute = Assert.Single(childContent.BoundAttributes);
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, contextAttribute.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, contextAttribute.Name);
Assert.Equal("System.String", contextAttribute.TypeName);
Assert.Equal("Specifies the parameter name for the 'ChildContent2' child content expression.", contextAttribute.Documentation);
Assert.True(contextAttribute.IsChildContentParameterNameProperty());
@ -1160,7 +1160,7 @@ namespace Test
},
a =>
{
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.True(a.IsChildContentParameterNameProperty());
},
a =>
@ -1179,7 +1179,7 @@ namespace Test
// A RenderFragment<T> tag helper has a parameter to allow you to set the lambda parameter name.
var contextAttribute = Assert.Single(childContent.BoundAttributes);
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, contextAttribute.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, contextAttribute.Name);
Assert.Equal("System.String", contextAttribute.TypeName);
Assert.Equal("Specifies the parameter name for the 'ChildContent2' child content expression.", contextAttribute.Documentation);
Assert.True(contextAttribute.IsChildContentParameterNameProperty());
@ -1245,7 +1245,7 @@ namespace Test
},
a =>
{
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.True(a.IsChildContentParameterNameProperty());
},
a =>
@ -1264,7 +1264,7 @@ namespace Test
// A RenderFragment<T> tag helper has a parameter to allow you to set the lambda parameter name.
var contextAttribute = Assert.Single(childContent.BoundAttributes);
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, contextAttribute.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, contextAttribute.Name);
Assert.Equal("System.String", contextAttribute.TypeName);
Assert.Equal("Specifies the parameter name for the 'ChildContent2' child content expression.", contextAttribute.Documentation);
}
@ -1321,7 +1321,7 @@ namespace Test
},
a =>
{
Assert.Equal(BlazorMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.Equal(ComponentMetadata.ChildContent.ParameterAttributeName, a.Name);
Assert.True(a.IsChildContentParameterNameProperty());
},
a =>

View File

@ -51,9 +51,9 @@ namespace Test
// here and then ignoring them.
Assert.Empty(item.Diagnostics);
Assert.False(item.HasErrors);
Assert.Equal(BlazorMetadata.EventHandler.TagHelperKind, item.Kind);
Assert.Equal(ComponentMetadata.EventHandler.TagHelperKind, item.Kind);
Assert.Equal(bool.TrueString, item.Metadata[TagHelperMetadata.Common.ClassifyAttributesOnly]);
Assert.Equal(BlazorMetadata.EventHandler.RuntimeName, item.Metadata[TagHelperMetadata.Runtime.Name]);
Assert.Equal(ComponentMetadata.EventHandler.RuntimeName, item.Metadata[TagHelperMetadata.Runtime.Name]);
Assert.False(item.IsDefaultKind());
Assert.False(item.KindUsesDefaultTagHelperRuntime());
@ -89,7 +89,7 @@ namespace Test
// Invariants
Assert.Empty(attribute.Diagnostics);
Assert.False(attribute.HasErrors);
Assert.Equal(BlazorMetadata.EventHandler.TagHelperKind, attribute.Kind);
Assert.Equal(ComponentMetadata.EventHandler.TagHelperKind, attribute.Kind);
Assert.False(attribute.IsDefaultKind());
Assert.False(attribute.HasIndexer);
Assert.Null(attribute.IndexerNamePrefix);
@ -99,8 +99,8 @@ namespace Test
Assert.Collection(
attribute.Metadata.OrderBy(kvp => kvp.Key),
kvp => Assert.Equal(kvp, new KeyValuePair<string, string>(BlazorMetadata.Component.WeaklyTypedKey, bool.TrueString)),
kvp => Assert.Equal(kvp, new KeyValuePair<string, string>("Common.PropertyName", "onclick")));
kvp => Assert.Equal(kvp, new KeyValuePair<string, string>("Common.PropertyName", "onclick")),
kvp => Assert.Equal(kvp, new KeyValuePair<string, string>(ComponentMetadata.Component.WeaklyTypedKey, bool.TrueString)));
Assert.Equal(
"Sets the 'onclick' attribute to the provided string or delegate value. " +

View File

@ -30,9 +30,9 @@ namespace Microsoft.CodeAnalysis.Razor
Assert.Null(item.TagOutputHint);
Assert.Empty(item.Diagnostics);
Assert.False(item.HasErrors);
Assert.Equal(BlazorMetadata.Ref.TagHelperKind, item.Kind);
Assert.Equal(ComponentMetadata.Ref.TagHelperKind, item.Kind);
Assert.Equal(bool.TrueString, item.Metadata[TagHelperMetadata.Common.ClassifyAttributesOnly]);
Assert.Equal(BlazorMetadata.Ref.RuntimeName, item.Metadata[TagHelperMetadata.Runtime.Name]);
Assert.Equal(ComponentMetadata.Ref.RuntimeName, item.Metadata[TagHelperMetadata.Runtime.Name]);
Assert.False(item.IsDefaultKind());
Assert.False(item.KindUsesDefaultTagHelperRuntime());
@ -64,7 +64,7 @@ namespace Microsoft.CodeAnalysis.Razor
var attribute = Assert.Single(item.BoundAttributes);
Assert.Empty(attribute.Diagnostics);
Assert.False(attribute.HasErrors);
Assert.Equal(BlazorMetadata.Ref.TagHelperKind, attribute.Kind);
Assert.Equal(ComponentMetadata.Ref.TagHelperKind, attribute.Kind);
Assert.False(attribute.IsDefaultKind());
Assert.False(attribute.HasIndexer);
Assert.Null(attribute.IndexerNamePrefix);

View File

@ -236,7 +236,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
else
{
// For single phase compilation tests just use the base compilation's references.
// This will include the built-in Blazor components.
// This will include the built-in components.
var projectEngine = CreateProjectEngine(Configuration, BaseCompilation.References.ToArray());
var projectItem = CreateProjectItem(cshtmlRelativePath, cshtmlContent);