283 references to AddContent
Microsoft.AspNetCore.Components (2)
Rendering\RenderTreeBuilder.cs (1)
154=> AddContent(sequence, textContent?.ToString());
Routing\Router.cs (1)
270builder.AddContent(0, "Not found");
Microsoft.AspNetCore.Components.Authorization (2)
AuthorizeRouteView.cs (2)
24= state => builder => builder.AddContent(0, "Not authorized"); 26= builder => builder.AddContent(0, "Authorizing...");
Microsoft.AspNetCore.Components.Authorization.Tests (18)
AuthorizeRouteViewTest.cs (6)
184state => builder => builder.AddContent(0, $"Go away, {state.User.Identity.Name}"); 209state => builder => builder.AddContent(0, $"Go away, {state.User.Identity.Name}"); 253builder => builder.AddContent(0, "Hold on, we're checking your papers."); 386builder.AddContent(0, $"Hello from the page with message: {Message}"); 394builder.AddContent(0, "Layout starts here"); 396builder.AddContent(2, "Layout ends here");
AuthorizeViewTest.cs (10)
30context => builder => builder.AddContent(0, "This should not be rendered")); 58context => builder => builder.AddContent(0, $"You are not authorized, even though we know you are {context.User.Identity.Name}")); 122builder.AddContent(0, $"You are authenticated as {context.User.Identity.Name}")); 158builder.AddContent(0, $"You are authenticated as {context.User.Identity.Name}")); 194builder.AddContent(0, $"You are authenticated as {context.User.Identity.Name}")); 259context => builder => builder.AddContent(0, "You are not authorized")); 300authorizing: builder => builder.AddContent(0, "Auth pending..."), 301authorized: context => builder => builder.AddContent(0, $"Hello, {context.User.Identity.Name}!")); 359authorizing: builder => builder.AddContent(0, "Auth pending..."), 360authorized: context => builder => builder.AddContent(0, $"Hello, {context.User.Identity.Name}!"));
CascadingAuthenticationStateTest.cs (2)
166builder.AddContent(0, $"Authenticated: {identity.IsAuthenticated}; Name: {identity.Name}; Pending: False; Renders: {numRenders}"); 170builder.AddContent(0, $"Authenticated: False; Name: ; Pending: True; Renders: {numRenders}");
Microsoft.AspNetCore.Components.Performance (4)
RenderTreeDiffBuilderBenchmark.cs (4)
33original.AddContent(6, "Car"); 45original.AddContent(15, ""); 59modified.AddContent(6, "Car"); 72modified.AddContent(15, "No, you can't afford that.");
Microsoft.AspNetCore.Components.QuickGrid (1)
Columns\PropertyColumn.cs (1)
79=> builder.AddContent(0, _cellTextFunc!(item));
Microsoft.AspNetCore.Components.Server.Tests (16)
Circuits\CircuitHostTest.cs (2)
871builder.AddContent(0, Message); 911builder.AddContent(1, "some text");
Circuits\RemoteRendererTest.cs (14)
41builder.AddContent(1, "some text"); 62builder.AddContent(1, "some text"); 86builder.AddContent(1, "some text"); 111builder.AddContent(0, $"Value {i}"); 149builder.AddContent(1, "some text"); 206builder.AddContent(1, "some text"); 226builder.AddContent(1, "offline text"); 269builder.AddContent(1, "some text"); 289builder.AddContent(1, "offline text"); 337builder.AddContent(1, "some text"); 352builder.AddContent(1, "offline text"); 394builder.AddContent(1, "some text"); 409builder.AddContent(1, "offline text"); 735builder.AddContent(1, "some text");
Microsoft.AspNetCore.Components.Tests (206)
CascadingParameterTest.cs (7)
942builder.AddContent(0, $"CascadingParameter={CascadingParameter}; RegularParameter={RegularParameter}"); 966builder.AddContent(0, $"CascadingParameter={CascadingParameter}"); 986builder.AddContent(0, $"CascadingParameter={CascadingParameter}"); 1012builder.AddContent(0, $"CascadingParameter={CascadingParameter}; SingleDeliveryCascadingParameter={SingleDeliveryCascadingParameter.Text}; RegularParameter={RegularParameter}"); 1079builder.AddContent(0, $"Value 1 is '{Value}'."); 1090builder.AddContent(0, $"Value 2 is '{Value}'."); 1101builder.AddContent(0, $"The value is '{Value}'");
DynamicComponentTest.cs (2)
75builder.AddContent(0, "This is some child content"); 135builder.AddContent(0, $"Hello from TestComponent with IntProp={IntProp}");
LayoutViewTest.cs (15)
43builder.AddContent(123, "Hello"); 44builder.AddContent(456, "Goodbye"); 91builder.AddContent(123, "Hello"); 92builder.AddContent(456, "Goodbye"); 123builder.AddContent(123, "Hello"); 124builder.AddContent(456, "Goodbye"); 164builder.AddContent(0, "Initial content"); 174builder.AddContent(0, "Changed content"); 208builder.AddContent(0, "Some content"); 288builder.AddContent(0, "RootLayout starts here"); 290builder.AddContent(2, "RootLayout ends here"); 302builder.AddContent(0, "NestedLayout starts here"); 304builder.AddContent(2, "NestedLayout ends here"); 316builder.AddContent(0, "OtherNestedLayout starts here"); 318builder.AddContent(2, "OtherNestedLayout ends here");
RendererTest.cs (32)
36builder.AddContent(1, "some text"); 64builder.AddContent(0, "Hello"); 2039builder.AddContent(0, message); 2278builder.AddContent(0, "Hello"); 2318builder.AddContent(0, "Hello"); 2352builder.AddContent(0, "Hello"); 2392builder.AddContent(0, "Hello"); 2437builder.AddContent(0, "Hello"); 2476builder.AddContent(0, "Hello"); 2511builder.AddContent(0, "Hello"); 2561builder.AddContent(0, "Hello"); 2846builder.AddContent(0, "Child event count: " + eventCount); 2936builder.AddContent(0, $"Render count: {++renderCount}"); 2972builder.AddContent(2, $"Parent render count: {++parentRenderCount}"); 3032builder.AddContent(0, "Some frame so the child isn't at position zero"); 3279builder.AddContent(5, "child text"); 4169builder.AddContent(1, "some text"); 4212builder.AddContent(0, "Hello"); 4240builder.AddContent(0, "Hello"); 4272builder.AddContent(0, "Hello"); 4300builder.AddContent(0, "Hello"); 4905builder.AddContent(0, "Hello"); 4993builder.AddContent(1, "some text"); 5015builder.AddContent(1, "some text"); 5232builder.AddContent(0, Message); 5246builder.AddContent(2, Text); 5358builder.AddContent(6, $"Render count: {++renderCount}"); 5378builder.AddContent(0, "Parent here"); 5410builder.AddContent(0, "Child is here"); 5466builder.AddContent(0, $"Hello from {nameof(MultiRendererComponent)}"); 5684builder.AddContent(1, $"Id: {component.TestId} BuildRenderTree, {Guid.NewGuid()}"); 6031builder.AddContent(1, "Hello");
Rendering\RenderTreeBuilderTest.cs (28)
33builder.AddContent(0, "First item"); 34builder.AddContent(0, nullString); 35builder.AddContent(0, "Second item"); 161builder.AddContent(0, "some frame so that the element isn't at position zero"); 179builder.AddContent(0, "child 1"); 180builder.AddContent(0, "child 2"); 182builder.AddContent(0, "unrelated item"); 197builder.AddContent(0, "standalone text 1"); // 0: standalone text 1 199builder.AddContent(0, "root text 1"); // 2: root text 1 200builder.AddContent(0, "root text 2"); // 3: root text 2 202builder.AddContent(0, "child text"); // 5: child text 204builder.AddContent(0, "grandchild text 1"); // 7: grandchild text 1 205builder.AddContent(0, "grandchild text 2"); // 8: grandchild text 2 208builder.AddContent(0, "root text 3"); // 9: root text 3 212builder.AddContent(0, "standalone text 2"); // 11: standalone text 2 243builder.AddContent(0, "some text"); // 5: some text 477builder.AddContent(1, "hello"); 492builder.AddContent(1, "hello"); 507builder.AddContent(1, "hello"); 663builder.AddContent(3, "Hello"); // 2: Hello 668builder.AddContent(6, "Goodbye"); // 5: Goodbye 689fragmentBuilder.AddContent(0, "Hello from the fragment"); 691fragmentBuilder.AddContent(2, "Some text"); 720builder.AddContent(3, "some text"); // 3: some text 809builder.AddContent(3, "some text"); // 3: some text 894builder.AddContent(0, "some text"); 896builder.AddContent(2, "more text"); 1871builder.AddContent(0, "hey");
RenderTreeDiffBuilderTest.cs (114)
51builder => builder.AddContent(0, "Hello"), 74oldTree.AddContent(0, "text0"); 75oldTree.AddContent(2, "text2"); 76newTree.AddContent(0, "text0"); 77newTree.AddContent(1, "text1"); 78newTree.AddContent(2, "text2"); 97oldTree.AddContent(0, "text0"); 98oldTree.AddContent(1, "text1"); 99oldTree.AddContent(2, "text2"); 100newTree.AddContent(0, "text0"); 101newTree.AddContent(2, "text2"); 117oldTree.AddContent(1, "Existing"); 122newTree.AddContent(1, "Inserted"); 127newTree.AddContent(1, "Existing"); 152oldTree.AddContent(1, "First"); 157oldTree.AddContent(1, "Second"); 162newTree.AddContent(1, "Second"); 182oldTree.AddContent(1, "Original"); 187newTree.AddContent(1, "Inserted"); 558oldTree.AddContent(0, "x"); // Loop start 559oldTree.AddContent(1, "x"); // Will be removed 560oldTree.AddContent(2, "x"); // Will be removed 561oldTree.AddContent(0, "x"); // Loop start 562newTree.AddContent(0, "x"); // Loop start 563newTree.AddContent(0, "x"); // Loop start 578oldTree.AddContent(10, "x"); // Loop start 579oldTree.AddContent(10, "x"); // Loop start 580newTree.AddContent(10, "x"); // Loop start 581newTree.AddContent(11, "x"); // Will be added 582newTree.AddContent(12, "x"); // Will be added 583newTree.AddContent(10, "x"); // Loop start 608oldTree.AddContent(0, "x"); 609oldTree.AddContent(1, "x"); 610oldTree.AddContent(0, "x"); // Will be removed 611oldTree.AddContent(1, "x"); // Will be removed 612newTree.AddContent(0, "x"); 613newTree.AddContent(1, "x"); 628oldTree.AddContent(10, "x"); 629oldTree.AddContent(11, "x"); 630newTree.AddContent(10, "x"); 631newTree.AddContent(11, "x"); 632newTree.AddContent(10, "x"); // Will be added 633newTree.AddContent(11, "x"); // Will be added 658oldTree.AddContent(12, "x"); 659oldTree.AddContent(12, "x"); // Note that the '0' and '1' items are not present on this iteration 660newTree.AddContent(12, "x"); 661newTree.AddContent(10, "x"); 662newTree.AddContent(11, "x"); 663newTree.AddContent(12, "x"); 688oldTree.AddContent(2, "x"); 689oldTree.AddContent(0, "x"); 690oldTree.AddContent(1, "x"); 691oldTree.AddContent(2, "x"); 692newTree.AddContent(2, "x"); 693newTree.AddContent(2, "x"); // Note that the '0' and '1' items are not present on this iteration 708oldTree.AddContent(0, "text"); 709newTree.AddContent(1, "text"); 724oldTree.AddContent(123, "old text 1"); 725oldTree.AddContent(182, "old text 2"); 726newTree.AddContent(123, "new text 1"); 727newTree.AddContent(182, "new text 2"); 1320oldTree.AddContent(09, "unrelated"); 1324oldTree.AddContent(13, "grandchild old text"); 1329newTree.AddContent(09, "unrelated"); 1333newTree.AddContent(13, "grandchild new text"); 1362oldTree.AddContent(11, "Text that will change"); 1365oldTree.AddContent(14, "Text that will not change"); 1371newTree.AddContent(11, "Text that has changed"); 1374newTree.AddContent(14, "Text that will not change"); 1398oldTree.AddContent(10, "text1"); 1399oldTree.AddContent(11, "text2"); 1400oldTree.AddContent(12, "text3"); 1401oldTree.AddContent(13, "text4"); 1402newTree.AddContent(10, "text1"); 1403newTree.AddContent(11, "text2modified"); 1404newTree.AddContent(12, "text3"); 1405newTree.AddContent(13, "text4"); 1424oldTree.AddContent(0, "Will not change"); 1425newTree.AddContent(0, "Will not change"); 1428newTree.AddContent(0, "text1"); 1452oldTree.AddContent(1, "Start"); 1453oldTree.AddContent(3, "End"); 1454newTree.AddContent(1, "Start"); 1456newTree.AddContent(4, "Text inside region"); // Sequence number is unrelated to outside the region 1458newTree.AddContent(6, "Text inside nested region"); 1461newTree.AddContent(3, "End"); 1486oldTree.AddContent(1, "Start"); 1488oldTree.AddContent(4, "Text inside region"); // Sequence number is unrelated to outside the region 1490oldTree.AddContent(6, "Text inside nested region"); 1493oldTree.AddContent(3, "End"); 1494newTree.AddContent(1, "Start"); 1495newTree.AddContent(3, "End"); 1510oldTree.AddContent(1, "Start"); 1512oldTree.AddContent(4, "Text inside region"); 1513oldTree.AddContent(5, "Text to move"); 1517oldTree.AddContent(3, "End"); 1518newTree.AddContent(1, "Start"); 1520newTree.AddContent(4, "Changed text inside region"); 1522newTree.AddContent(5, "Text to move"); // Although it's the same sequence and content, it's now in a different region so not the same 1525newTree.AddContent(3, "End"); 1551oldTree.AddContent(10, "text1"); // 0: text1 1554newTree.AddContent(10, "text1"); // 0: text1 1613oldTree.AddContent(10, "text1"); // 0: text1 1620newTree.AddContent(10, "text1"); // 0: text1 1969oldTree.AddContent(1, "First"); 1972oldTree.AddContent(2, "Unkeyed item"); 1976oldTree.AddContent(1, "Second"); 1981newTree.AddContent(1, "Second"); 1984newTree.AddContent(2, "Unkeyed item"); 1988newTree.AddContent(1, "First modified"); 2024oldTree.AddContent(2, "Unkeyed item"); 2040newTree.AddContent(2, "Unkeyed item"); 2171oldTree.AddContent(1, "Hello!"); 2174newTree.AddContent(0, "some text");
RouteViewTest.cs (6)
184builder.AddContent(0, $"Hello from the page with message '{Message}'"); 195builder.AddContent(0, $"Hello from the page with message '{Message}'"); 206builder.AddContent(0, "Layout starts here"); 208builder.AddContent(2, "Layout ends here"); 219builder.AddContent(0, "OtherLayout starts here"); 221builder.AddContent(2, "OtherLayout ends here");
Routing\RouterTest.cs (2)
33_router.Found = routeData => (builder) => builder.AddContent(0, $"Rendering route matching {routeData.PageType}"); 235{ nameof(Router.NotFound), (RenderFragment)(builder => builder.AddContent(0, "Custom content")) },
Microsoft.AspNetCore.Components.Web (3)
Forms\ValidationMessage.cs (1)
76builder.AddContent(3, message);
Forms\ValidationSummary.cs (1)
82builder.AddContent(5, error);
Head\HeadOutlet.cs (1)
62builder.AddContent(1, _defaultTitle);
Microsoft.AspNetCore.Components.Web.Tests (28)
HtmlRendering\HtmlRendererTest.cs (28)
75rtb.AddContent(1, "Hello world!"); 98rtb.AddContent(1, "<Hello world!>"); 145rtb.AddContent(2, "Hello world!"); 178rtb.AddContent(4, "Hello world!"); 202rtb.AddContent(2, "Hello world!"); 273rtb.AddContent(2, "Hello world!"); 302rtb.AddContent(2, "Hello world!"); 305rtb.AddContent(4, "Bye Bye world!"); 345rtb.AddContent(8, $"Pick value {optionValue}"); 353rtb.AddContent(11, "unrelated option"); 404rtb.AddContent(3, "Hello <html>-encoded content!"); 452rtb.AddContent(3, "Some content"); 499rtb.AddContent(1, "Something"); 559rtb.AddContent(5, optionValue); 590rtb.AddContent(2, "Hello world!"); 621rtb.AddContent(2, "Hello world!"); 687rtb.AddContent(2, rf => rf.AddContent(0, "Hello world!")); 716rtb.AddContent(3, rf => rf.AddContent(0, "Hello world!")); 824builder.AddContent(0, "Hello from the section content provider"); 841builder.AddContent(1, "Hey!"); 991rtb.AddContent(2, name); 995rtb.AddContent(5, name); 1231builder.AddContent(1, Value.ToString(CultureInfo.InvariantCulture)); 1261builder.AddContent(1, Value.ToString(CultureInfo.InvariantCulture)); 1289rtb.AddContent(2, content); 1331=> builder.AddContent(0, status); 1355builder.AddContent(0, "Hello"); 1362builder.AddContent(1, "Goodbye");
Microsoft.AspNetCore.Components.WebView.Test (2)
WebViewManagerTests.cs (2)
134builder.AddContent(1, "Hello world!"); 158builder.AddContent(1, "Hello world!");
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
ComponentTagHelperTest.cs (1)
104builder.AddContent(0, "Hello from the component");