213 references to AddAttribute
Microsoft.AspNetCore.Components.Endpoints (1)
Assets\ImportMap.cs (1)
64builder.AddAttribute(1, "type", "importmap");
Microsoft.AspNetCore.Components.Performance (17)
RenderTreeDiffBuilderBenchmark.cs (17)
27original.AddAttribute(1, "class", "form-group"); 30original.AddAttribute(3, "class", "control-label"); 31original.AddAttribute(4, "for", "name"); 37original.AddAttribute(8, "class", "form-control"); 38original.AddAttribute(9, "type", "text"); 39original.AddAttribute(10, "name", "name"); // Notice the gap in sequence numbers 40original.AddAttribute(12, "value", ""); 44original.AddAttribute(14, "class", "text-danger field-validation-valid"); 53modified.AddAttribute(1, "class", "form-group"); 56modified.AddAttribute(3, "class", "control-label"); 57modified.AddAttribute(4, "for", "name"); 63modified.AddAttribute(8, "class", "form-control"); 64modified.AddAttribute(9, "type", "text"); 65modified.AddAttribute(10, "name", "name"); 66modified.AddAttribute(11, "data-validation-state", "invalid"); 67modified.AddAttribute(12, "value", "Lamborghini"); 71modified.AddAttribute(14, "class", "text-danger field-validation-invalid"); // changed
Microsoft.AspNetCore.Components.Tests (127)
RendererTest.cs (3)
5487builder.AddAttribute(1, "type", "checkbox"); 5492builder.AddAttribute(5, "value", BindConverter.FormatValue(SomeStringProperty)); 5911builder.AddAttribute(1, nameof(BoundString), BoundString);
Rendering\RenderTreeBuilderTest.cs (32)
239builder.AddAttribute(0, "attribute1", "value 1"); // 1: attribute1="value 1" 284builder.AddAttribute(0, "attribute1", "value 1"); 302builder.AddAttribute(0, "attribute4", (string)null); 304builder.AddAttribute(0, "attribute7", "the end"); 330builder.AddAttribute(0, "attribute1", "value1"); 437builder.AddAttribute(0, "name", "value"); 478builder.AddAttribute(2, "name", "value"); 522builder.AddAttribute(1, "name", "value"); 551builder.AddAttribute(2, "name", "value"); 566builder.AddAttribute(2, "name", "value"); 636builder.AddAttribute(12, "child1attribute1", "A"); // 2: child1attribute1="A" 637builder.AddAttribute(13, "child1attribute2", "B"); // 3: child1attribute2="B"> 640builder.AddAttribute(15, "child2attribute", "C"); // 5: child2attribute="C"> 987builder.AddAttribute(1, "attr", "hi"); 1005builder.AddAttribute(1, "attr", (string)null); 1024builder.AddAttribute(1, "attr", value); 1697builder.AddAttribute(1, "attribute before", "before value"); 1699builder.AddAttribute(2, "attribute after", "after value"); 1818builder.AddAttribute(0, "id", "hi"); 1819builder.AddAttribute(0, "id", "bye"); 1841builder.AddAttribute(0, "id", "hi"); 1866builder.AddAttribute(0, "id", "hi"); 1891builder.AddAttribute(0, "id", "hi"); 1914builder.AddAttribute(0, "id", "hi"); 1938builder.AddAttribute(0, "id", (string)null); 1961builder.AddAttribute(0, "id", "hi"); 1967builder.AddAttribute(0, "id", "hi"); 1968builder.AddAttribute(0, "id", "bye"); 1991builder.AddAttribute(0, "A", "hi"); 1999builder.AddAttribute(0, "3", "see ya"); // Overwrite value added by splat 2001builder.AddAttribute(0, "5", "another one"); 2274builder.AddAttribute(2, "a", "b");
RenderTreeDiffBuilderTest.cs (86)
60builder.AddAttribute(1, "My attribute", "My value"); 837oldTree.AddAttribute(1, "existing", "existing value"); 840newTree.AddAttribute(1, "existing", "existing value"); 841newTree.AddAttribute(2, "added", "added value"); 862oldTree.AddAttribute(1, "will be removed", "will be removed value"); 863oldTree.AddAttribute(2, "will survive", "surviving value"); 866newTree.AddAttribute(2, "will survive", "surviving value"); 886oldTree.AddAttribute(1, "will remain", "will remain value"); 887oldTree.AddAttribute(2, "will change", "will change value"); 890newTree.AddAttribute(1, "will remain", "will remain value"); 891newTree.AddAttribute(2, "will change", "did change value"); 946oldTree.AddAttribute(1, "oldname", "same value"); 949newTree.AddAttribute(1, "newname", "same value"); 975oldTree.AddAttribute(0, "attr2", "value2"); 976oldTree.AddAttribute(0, "attr3", "value3"); 979newTree.AddAttribute(0, "attr1", "value1"); 980newTree.AddAttribute(0, "attr2", "value2"); 981newTree.AddAttribute(0, "attr3", "value3"); 1005oldTree.AddAttribute(0, "attr1", "value1"); 1006oldTree.AddAttribute(0, "attr3", "value3"); 1009newTree.AddAttribute(0, "attr1", "value1"); 1010newTree.AddAttribute(0, "attr2", "value2"); 1011newTree.AddAttribute(0, "attr3", "value3"); 1036oldTree.AddAttribute(0, "attr1", "value1"); 1037oldTree.AddAttribute(0, "attr2", "value2"); 1040newTree.AddAttribute(0, "attr1", "value1"); 1041newTree.AddAttribute(0, "attr2", "value2"); 1042newTree.AddAttribute(0, "attr3", "value3"); 1067oldTree.AddAttribute(2, "attr2", "value2"); 1068oldTree.AddAttribute(3, "attr3", "value3"); 1071newTree.AddAttribute(1, "attr1", "value1"); 1072newTree.AddAttribute(2, "attr2", "value2"); 1073newTree.AddAttribute(3, "attr3", "value3"); 1097oldTree.AddAttribute(1, "attr1", "value1"); 1098oldTree.AddAttribute(3, "attr3", "value3"); 1101newTree.AddAttribute(1, "attr1", "value1"); 1102newTree.AddAttribute(2, "attr2", "value2"); 1103newTree.AddAttribute(3, "attr3", "value3"); 1128oldTree.AddAttribute(1, "attr1", "value1"); 1129oldTree.AddAttribute(2, "attr2", "value2"); 1132newTree.AddAttribute(1, "attr1", "value1"); 1133newTree.AddAttribute(2, "attr2", "value2"); 1134newTree.AddAttribute(3, "attr3", "value3"); 1159oldTree.AddAttribute(0, "attr1", "value1"); 1160oldTree.AddAttribute(0, "attr2", "value2"); 1161oldTree.AddAttribute(0, "attr3", "value3"); 1164newTree.AddAttribute(0, "attr2", "value2"); 1165newTree.AddAttribute(0, "attr3", "value3"); 1186oldTree.AddAttribute(0, "attr1", "value1"); 1187oldTree.AddAttribute(0, "attr2", "value2"); 1188oldTree.AddAttribute(0, "attr3", "value3"); 1191newTree.AddAttribute(0, "attr1", "value1"); 1192newTree.AddAttribute(0, "attr3", "value3"); 1213oldTree.AddAttribute(0, "attr1", "value1"); 1214oldTree.AddAttribute(0, "attr2", "value2"); 1215oldTree.AddAttribute(0, "attr3", "value3"); 1218newTree.AddAttribute(0, "attr1", "value1"); 1219newTree.AddAttribute(0, "attr2", "value2"); 1240oldTree.AddAttribute(1, "attr1", "value1"); 1241oldTree.AddAttribute(2, "attr2", "value2"); 1242oldTree.AddAttribute(3, "attr3", "value3"); 1245newTree.AddAttribute(2, "attr2", "value2"); 1246newTree.AddAttribute(3, "attr3", "value3"); 1267oldTree.AddAttribute(1, "attr1", "value1"); 1268oldTree.AddAttribute(2, "attr2", "value2"); 1269oldTree.AddAttribute(3, "attr3", "value3"); 1272newTree.AddAttribute(1, "attr1", "value1"); 1273newTree.AddAttribute(3, "attr3", "value3"); 1294oldTree.AddAttribute(1, "attr1", "value1"); 1295oldTree.AddAttribute(2, "attr2", "value2"); 1296oldTree.AddAttribute(3, "attr3", "value3"); 1299newTree.AddAttribute(1, "attr1", "value1"); 1300newTree.AddAttribute(2, "attr2", "value2"); 1682newTree.AddAttribute(0, "another-attribute", "go down the slow path please"); 2223oldTree.AddAttribute(1, "attr1", "unrelated val1"); 2227newTree.AddAttribute(1, "attr1", "unrelated val1"); 2254oldTree.AddAttribute(1, "attr1", "unrelated val1"); 2262newTree.AddAttribute(1, "attr1", "unrelated val1"); 2284newTree.AddAttribute(1, "attr1", "unrelated val1"); 2336oldTree.AddAttribute(1, $"myattribute_{i}", "value"); 2341newTree.AddAttribute(1, $"myattribute_{i}", "value"); 2345newTree.AddAttribute(1, $"myattribute_final", "value"); 2369oldTree.AddAttribute(1, $"myattribute_{i}", "value"); 2374newTree.AddAttribute(1, $"myattribute_{i}", "value"); 2378oldTree.AddAttribute(1, $"myattribute_final", "value"); 2449builder.AddAttribute(1, "attrib", attributeValue);
RenderTreeUpdaterTest.cs (6)
22builder.AddAttribute(2, valuePropName, "initial value"); 50builder.AddAttribute(2, valuePropName, "initial value"); 75builder.AddAttribute(2, valuePropName, "unchanged 1"); 80builder.AddAttribute(5, "unrelated prop before", "unchanged 2"); 81builder.AddAttribute(6, valuePropName, "initial value"); 82builder.AddAttribute(7, "unrelated prop after", "unchanged 3");
Microsoft.AspNetCore.Components.Web (34)
Forms\AntiforgeryToken.cs (3)
43builder.AddAttribute(1, "type", "hidden"); 44builder.AddAttribute(2, "name", _requestToken!.FormFieldName); 45builder.AddAttribute(3, "value", _requestToken.Value);
Forms\EditForm.cs (2)
144builder.AddAttribute(2, "method", "post"); 149builder.AddAttribute(3, "data-enhance", "");
Forms\InputCheckbox.cs (3)
36builder.AddAttribute(2, "type", "checkbox"); 38builder.AddAttribute(4, "class", CssClass); 43builder.AddAttribute(6, "value", bool.TrueString);
Forms\InputDate.cs (3)
88builder.AddAttribute(2, "type", _typeAttributeValue); 90builder.AddAttribute(4, "class", CssClass); 91builder.AddAttribute(5, "value", CurrentValueAsString);
Forms\InputFile.cs (1)
62builder.AddAttribute(2, "type", "file");
Forms\InputNumber.cs (3)
55builder.AddAttribute(1, "step", _stepAttributeValue); 56builder.AddAttribute(2, "type", "number"); 60builder.AddAttribute(6, "value", CurrentValueAsString);
Forms\InputRadio.cs (4)
68builder.AddAttribute(3, "type", "radio"); 69builder.AddAttribute(4, "name", Context.GroupName); 70builder.AddAttribute(5, "value", BindConverter.FormatValue(Value?.ToString())); 71builder.AddAttribute(6, "checked", Context.CurrentValue?.Equals(Value) == true ? GetToggledTrueValue() : null);
Forms\InputSelect.cs (2)
49builder.AddAttribute(5, "value", BindConverter.FormatValue(CurrentValue)?.ToString()); 55builder.AddAttribute(7, "value", CurrentValueAsString);
Forms\InputText.cs (1)
38builder.AddAttribute(4, "value", CurrentValueAsString);
Forms\InputTextArea.cs (1)
38builder.AddAttribute(4, "value", CurrentValueAsString);
Forms\RenderTreeBuilderExtensions.cs (1)
15builder.AddAttribute(sequence, name, value);
Forms\ValidationMessage.cs (1)
74builder.AddAttribute(1, "class", "validation-message");
Forms\ValidationSummary.cs (2)
76builder.AddAttribute(1, "class", "validation-errors"); 81builder.AddAttribute(4, "class", "validation-message");
Routing\FocusOnNavigate.cs (1)
70builder.AddAttribute(1, "selector", Selector);
Routing\NavLink.cs (2)
165builder.AddAttribute(2, "class", CssClass); 168builder.AddAttribute(3, "aria-current", "page");
Virtualization\Virtualize.cs (3)
225builder.AddAttribute(1, "style", GetSpacerStyle(_itemsBefore)); 286builder.AddAttribute(8, "style", GetSpacerStyle(itemsAfter, _unusedItemCapacity)); 460builder.AddAttribute(1, "style", $"height: {_itemSize.ToString(CultureInfo.InvariantCulture)}px; flex-shrink: 0;");
Web\ErrorBoundary.cs (1)
48builder.AddAttribute(3, "class", "blazor-error-boundary");
Microsoft.AspNetCore.Components.Web.Tests (34)
Forms\Mapping\FormMappingScopeTest.cs (5)
33builder.AddAttribute(1, nameof(FormMappingScope.Name), "named-context"); 55b.AddAttribute(1, nameof(FormMappingScope.Name), "child-context"); 63builder.AddAttribute(1, nameof(FormMappingScope.Name), "parent-context"); 85builder.AddAttribute(1, nameof(FormMappingScope.Name), name); 120builder.AddAttribute(1, nameof(FormMappingScope.Name), contextName);
HtmlRendering\HtmlRendererTest.cs (28)
144rtb.AddAttribute(1, "class", "lead"); 175rtb.AddAttribute(1, "class", "test1"); 176rtb.AddAttribute(2, "another", "another-value"); 201rtb.AddAttribute(1, "class", "<lead"); 337rtb.AddAttribute(2, "unrelated-attribute-before", "a"); 338rtb.AddAttribute(3, "value", "b"); 339rtb.AddAttribute(4, "unrelated-attribute-after", "c"); 343rtb.AddAttribute(6, "unrelated-attribute", "a"); 344rtb.AddAttribute(7, "value", optionValue); 352rtb.AddAttribute(10, "value", "b"); 377rtb.AddAttribute(1, "value", "Hello <html>-encoded content!"); 378rtb.AddAttribute(2, "rows", "10"); 379rtb.AddAttribute(3, "cols", "20"); 402rtb.AddAttribute(1, "rows", "10"); 403rtb.AddAttribute(2, "cols", "20"); 427rtb.AddAttribute(1, "rows", "10"); 428rtb.AddAttribute(2, "cols", "20"); 451rtb.AddAttribute(1, "value", "Hello World!"); 475rtb.AddAttribute(1, "value", "Hello <html>-encoded content!"); 476rtb.AddAttribute(2, "id", "Test"); 522rtb.AddAttribute(1, "value", "Hello <html>-encoded content!"); 523rtb.AddAttribute(2, "id", "Test"); 552rtb.AddAttribute(1, "value", "beta"); 558rtb.AddAttribute(4, "value", optionValue); 594rtb.AddAttribute(4, "Value", "Child content!"); 625rtb.AddAttribute(4, "Value", "Child content!"); 1148rtb.AddAttribute(1, "method", "post"); 1170rtb.AddAttribute(1, "action", "https://example.com/explicit");
Virtualization\VirtualizeTest.cs (1)
135builder.AddAttribute(1, "style", "overflow: auto; height: 800px;");