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