1 write to Name
Microsoft.CodeAnalysis.Razor.Compiler (1)
Language\BoundAttributeDescriptor.cs (1)
67
Name
= name;
159 references to Name
Microsoft.AspNetCore.Razor.Language.UnitTests (1)
Extensions\PreallocatedAttributeTargetExtensionTest.cs (1)
151
AttributeName = attribute.
Name
,
Microsoft.CodeAnalysis.Razor.Compiler (47)
Language\BoundAttributeDescriptor.cs (1)
87
builder.Append(
Name
);
Language\Components\ComponentBindLoweringPass.cs (4)
180
node.BoundAttribute.
Name
));
763
if (valueAttribute is null && string.Equals(valueAttributeName, attribute.
Name
, comparison))
769
if (changeAttribute is null && string.Equals(changeAttributeName, attribute.
Name
, comparison))
775
if (expressionAttribute is null && string.Equals(expressionAttributeName, attribute.
Name
, comparison))
Language\Components\ComponentDiagnosticFactory.cs (3)
191
var supportedElements = string.Join(", ", component.Component.GetChildContentProperties().Select(p => $"'{p.
Name
}'"));
251
var attributesText = string.Join(", ", attributes.Select(a => $"'{a.
Name
}'"));
268
var attributesText = string.Join(", ", attributes.Select(a => $"'{a.
Name
}'"));
Language\Components\ComponentGenericTypePass.cs (3)
68
.Select(p => p.
Name
)
72
bindings.Add(attribute.
Name
, new Binding(attribute));
211
.Select(t => t.
Name
)
Language\Components\ComponentLoweringPass.cs (12)
263
if (string.Equals(property.AttributeName, typeParam.
Name
, StringComparison.Ordinal))
283
result.Add(typeParam.
Name
);
320
genericParamNames.Add(attr.
Name
);
327
nonGenericParamNames.Add(attr.
Name
);
385
if (!IsPresentAsAttribute(requiredAttribute.
Name
, intermediateNode))
391
requiredAttribute.
Name
));
517
.Where(a => string.Equals(a.
Name
, ComponentsApi.RenderTreeBuilder.ChildContent, StringComparison.Ordinal))
540
.Where(a => string.Equals(a.
Name
, tagHelperNode.TagName, StringComparison.Ordinal))
609
childContent.AddDiagnostic(ComponentDiagnosticFactory.Create_ChildContentHasInvalidParameter(property.Source, property.AttributeName, attribute.
Name
));
614
childContent.AddDiagnostic(ComponentDiagnosticFactory.Create_ChildContentHasInvalidAttribute(property.Source, property.AttributeName, attribute.
Name
));
619
childContent.AddDiagnostic(ComponentDiagnosticFactory.Create_ChildContentHasInvalidAttribute(a.Source, a.AttributeName, attribute.
Name
));
624
childContent.AddDiagnostic(ComponentDiagnosticFactory.Create_ChildContentHasInvalidAttribute(directiveAttribute.Source, directiveAttribute.OriginalAttributeName, attribute.
Name
));
Language\Components\ComponentNodeWriter.cs (2)
304
writer.Write(string.Join(", ", node.Component.Component.GetTypeParameters().Select(a => a.
Name
)));
369
return attribute.
Name
;
Language\Intermediate\ComponentChildContentIntermediateNode.cs (1)
14
public string AttributeName => BoundAttribute?.
Name
?? ComponentsApi.RenderTreeBuilder.ChildContent;
Language\Intermediate\ComponentTypeArgumentIntermediateNode.cs (1)
12
public string TypeParameterName => BoundAttribute.
Name
;
Language\TagHelperMatchingConventions.cs (1)
256
return name.Equals(descriptor.
Name
.AsSpanOrDefault(), descriptor.GetComparison());
Language\TagHelpers\Producers\BindTagHelperProducer.cs (15)
407
if (!changeAttribute.
Name
.EndsWith("Changed", StringComparison.Ordinal) ||
421
var valueAttributeName = changeAttribute.
Name
[..^"Changed".Length];
426
if (attribute.
Name
== valueAttributeName)
431
if (attribute.
Name
== expressionAttributeName)
460
valueAttribute.
Name
,
461
changeAttribute.
Name
));
465
ValueAttribute = valueAttribute.
Name
,
466
ChangeAttribute = changeAttribute.
Name
471
metadata.ExpressionAttribute = expressionAttribute.
Name
;
480
attribute.Name = "@bind-" + valueAttribute.
Name
;
491
attribute.Name = "@bind-" + valueAttribute.
Name
+ ":get";
497
attribute.Name = "@bind-" + valueAttribute.
Name
+ ":set";
508
valueAttribute.
Name
,
509
changeAttribute.
Name
));
511
attribute.Name = "@bind-" + valueAttribute.
Name
;
Language\TagHelpers\Producers\ComponentTagHelperProducer.cs (3)
550
var typeName = component.TypeName + "." + attribute.
Name
;
570
r.TagName = attribute.
Name
;
578
CreateContextParameter(builder, attribute.
Name
);
Mvc\ViewComponentTagHelperTargetExtension.cs (1)
59
var attributeName = attribute.
Name
;
Microsoft.CodeAnalysis.Razor.UnitTests (92)
BindTagHelperProducerTest.cs (22)
159
Assert.Equal("@bind-MyProperty", attribute.
Name
);
322
Assert.Equal("@bind-MyProperty", attribute.
Name
);
448
var attribute = Assert.Single(bind.BoundAttributes, a => a.
Name
.StartsWith("@bind", StringComparison.Ordinal));
469
var attribute = Assert.Single(bind.BoundAttributes, a => a.
Name
.StartsWith("@bind", StringComparison.Ordinal));
481
var attribute = Assert.Single(bind.BoundAttributes, a => a.
Name
.StartsWith("@bind", StringComparison.Ordinal));
504
Assert.Equal("@bind", attribute.
Name
);
668
var attribute = Assert.Single(bind.BoundAttributes, a => a.
Name
.StartsWith("@bind", StringComparison.Ordinal));
669
Assert.Equal("@bind-myprop", attribute.
Name
);
673
attribute = Assert.Single(bind.BoundAttributes, a => a.
Name
.StartsWith("format", StringComparison.Ordinal));
674
Assert.Equal("format-myprop", attribute.
Name
);
696
var attribute = Assert.Single(bind.BoundAttributes, a => a.
Name
.StartsWith("@bind", StringComparison.Ordinal));
697
Assert.Equal("@bind-myprop", attribute.
Name
);
701
attribute = Assert.Single(bind.BoundAttributes, a => a.
Name
.StartsWith("format", StringComparison.Ordinal));
702
Assert.Equal("format-myprop", attribute.
Name
);
767
var attribute = Assert.Single(bind.BoundAttributes, a => a.
Name
.StartsWith("@bind", StringComparison.Ordinal));
768
Assert.Equal("@bind", attribute.
Name
);
859
var attribute = Assert.Single(bind.BoundAttributes, a => a.
Name
.StartsWith("@bind", StringComparison.Ordinal));
860
Assert.Equal("@bind", attribute.
Name
);
953
var attribute = Assert.Single(bind.BoundAttributes, a => a.
Name
.StartsWith("@bind", StringComparison.Ordinal));
954
Assert.Equal("@bind-somevalue", attribute.
Name
);
1062
var attribute = Assert.Single(bind.BoundAttributes, a => a.
Name
.StartsWith("@bind", StringComparison.Ordinal));
1083
Assert.Equal("@bind-...", attribute.
Name
);
ComponentTagHelperProducerTest.cs (63)
116
Assert.Equal("MyProperty", attribute.
Name
);
176
component.BoundAttributes.OrderBy(a => a.
Name
),
179
Assert.Equal("MyProperty", a.
Name
);
187
Assert.Equal("T", a.
Name
);
228
Assert.Equal("MyProperty", attribute.
Name
);
335
Assert.Equal("MyProperty", attribute.
Name
);
383
Assert.Equal("MyProperty", attribute.
Name
);
426
Assert.Equal("MyProperty", attribute.
Name
);
469
component.BoundAttributes.OrderBy(a => a.
Name
),
472
Assert.Equal("MyProperty", a.
Name
);
481
Assert.Equal("T", a.
Name
);
528
component.BoundAttributes.OrderBy(a => a.
Name
),
531
Assert.Equal("MyProperty1", a.
Name
);
537
Assert.Equal("MyProperty2", a.
Name
);
543
Assert.Equal("MyProperty3", a.
Name
);
549
Assert.Equal("T", a.
Name
);
554
Assert.Equal("U", a.
Name
);
559
Assert.Equal("V", a.
Name
);
598
Assert.Equal("OnClick", attribute.
Name
);
643
component.BoundAttributes.OrderBy(a => a.
Name
),
646
Assert.Equal("OnClick", a.
Name
);
659
Assert.Equal("T", a.
Name
);
700
Assert.Equal("OnClick", attribute.
Name
);
746
component.BoundAttributes.OrderBy(a => a.
Name
),
749
Assert.Equal("OnClick", a.
Name
);
796
component.BoundAttributes.OrderBy(a => a.
Name
),
799
Assert.Equal("OnClick", a.
Name
);
813
Assert.Equal("T", a.
Name
);
854
Assert.Equal("ChildContent2", attribute.
Name
);
909
Assert.Equal("ChildContent2", a.
Name
);
923
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, a.
Name
);
934
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, contextAttribute.
Name
);
979
Assert.Equal("ChildContent2", a.
Name
);
993
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, a.
Name
);
1004
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, contextAttribute.
Name
);
1043
component.BoundAttributes.OrderBy(a => a.
Name
),
1046
Assert.Equal("ChildContent2", a.
Name
);
1061
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, a.
Name
);
1066
Assert.Equal("T", a.
Name
);
1080
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, contextAttribute.
Name
);
1120
component.BoundAttributes.OrderBy(a => a.
Name
),
1123
Assert.Equal("ChildContent2", a.
Name
);
1138
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, a.
Name
);
1143
Assert.Equal("T", a.
Name
);
1157
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, contextAttribute.
Name
);
1197
component.BoundAttributes.OrderBy(a => a.
Name
),
1200
Assert.Equal("ChildContent2", a.
Name
);
1215
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, a.
Name
);
1220
Assert.Equal("T", a.
Name
);
1234
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, contextAttribute.
Name
);
1278
component.BoundAttributes.OrderBy(a => a.
Name
),
1281
Assert.Equal("ChildContent2", a.
Name
);
1296
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, a.
Name
);
1301
Assert.Equal("T", a.
Name
);
1315
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, contextAttribute.
Name
);
1359
component.BoundAttributes.OrderBy(a => a.
Name
),
1362
Assert.Equal("ChildContent", a.
Name
);
1368
Assert.Equal(ComponentHelpers.ChildContent.ParameterAttributeName, a.
Name
);
1373
Assert.Equal("Footer", a.
Name
);
1379
Assert.Equal("Header", a.
Name
);
1497
component.BoundAttributes.OrderBy(a => a.
Name
),
1500
Assert.Equal("Footer", a.
Name
);
1505
Assert.Equal("Header", a.
Name
);
DefaultTagHelperDescriptorFactoryTest.cs (2)
518
Assert.Equal(expectedAttributeName, attributeDescriptor.
Name
);
861
foreach (var attribute in descriptor.BoundAttributes.Where(a => a.
Name
.StartsWith("data-", StringComparison.OrdinalIgnoreCase)))
EventHandlerTagHelperProducerTest.cs (2)
110
Assert.Equal("@onclick", attribute.
Name
);
244
Assert.Equal("@onclick", attribute.
Name
);
KeyTagHelperProducerTest.cs (1)
80
Assert.Equal("@key", attribute.
Name
);
RefTagHelperProducerTest.cs (1)
80
Assert.Equal("@ref", attribute.
Name
);
SplatTagHelperProducerTest.cs (1)
77
Assert.Equal("@attributes", attribute.
Name
);
Microsoft.CodeAnalysis.Razor.Workspaces (18)
CodeActions\Razor\GenerateEventHandlerCodeActionProvider.cs (2)
123
if (attribute.
Name
== attributeName)
188
if (attribute.
Name
== markupTagHelperDirectiveAttribute.TagHelperAttributeInfo.Name)
CodeActions\Razor\SimplifyTagToSelfClosingCodeActionProvider.cs (1)
130
componentParameterName.SequenceEqual(attribute.
Name
) &&
CodeActions\Razor\UnboundDirectiveAttributeAddUsingCodeActionProvider.cs (1)
123
boundAttribute.
Name
.AsSpan().SequenceEqual(baseAttributeName))
Completion\DirectiveAttributeCompletionItemProvider.cs (4)
178
if (!TryAddAttributeCompletion(attribute.
Name
, descriptionInfo, tagHelper, completionContext, attributeCompletions) &&
189
AddAttributeCompletion(attribute.
Name
, descriptionInfo, tagHelper, completionContext, attributeCompletions);
225
if (!attribute.
Name
.StartsWith(indexerNamePrefix))
256
: $"{attribute.
Name
}:{parameter.Name}";
Completion\TagHelperCompletionProvider.cs (1)
439
builder.Append(attribute.
Name
);
Completion\TagHelperCompletionService.cs (4)
83
if (!attributeDescriptor.
Name
.IsNullOrEmpty())
85
UpdateCompletions(attributeDescriptor.
Name
, attributeDescriptor);
99
if (attributeDescriptor.
Name
!= null)
101
htmlNameToBoundAttribute[attributeDescriptor.
Name
] = attributeDescriptor;
Extensions\TagHelperDescriptorExtensions.cs (1)
32
builder.Append(requiredAttribute.
Name
);
Formatting\FormattingVisitor.cs (2)
282
if (parentComponent.TagHelperInfo.BindingResult.TagHelpers.Any(d => d.BoundAttributes.Any(a => a.
Name
== propertyName)))
314
var typeParameterNames = descriptors.SelectMany(d => d.GetTypeParameters().Select(p => p.
Name
)).ToArray();
Formatting\Passes\CSharpFormattingPass.CSharpDocumentGenerator.cs (1)
280
descriptor.BoundAttributes.FirstOrDefault(d => d.
Name
== attribute.TagHelperAttributeInfo.Name) is { } boundAttribute &&
GoToDefinition\RazorComponentDefinitionHelpers.cs (1)
116
? boundTagHelper.BoundAttributes.FirstOrDefault(propertyName, static (a, propertyName) => a.
Name
== propertyName)
Microsoft.CodeAnalysis.Remote.Razor (1)
DevTools\RemoteDevToolsService.cs (1)
130
a.
Name
,