6 types derived from ComponentState
Microsoft.AspNetCore.Components.Authorization.Tests (1)
src\Components\Shared\test\TestRenderer.cs (1)
151class TestRendererComponentState : ComponentState, IAsyncDisposable
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\EndpointComponentState.cs (1)
15internal sealed class EndpointComponentState : ComponentState
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
ImportMapTest.cs (1)
360class TestRendererComponentState : ComponentState, IAsyncDisposable
Microsoft.AspNetCore.Components.Forms.Tests (1)
src\Components\Shared\test\TestRenderer.cs (1)
151class TestRendererComponentState : ComponentState, IAsyncDisposable
Microsoft.AspNetCore.Components.Tests (1)
src\Components\Shared\test\TestRenderer.cs (1)
151class TestRendererComponentState : ComponentState, IAsyncDisposable
Microsoft.AspNetCore.Components.Web.Tests (1)
src\Components\Shared\test\TestRenderer.cs (1)
151class TestRendererComponentState : ComponentState, IAsyncDisposable
3 instantiations of ComponentState
Microsoft.AspNetCore.Components (1)
RenderTree\Renderer.cs (1)
390=> new ComponentState(this, componentId, component, parentComponentState);
Microsoft.AspNetCore.Components.Server.Tests (1)
Circuits\RenderBatchWriterTest.cs (1)
206.WithComponent(new ComponentState(renderer, 2000, new FakeComponent(), null)),
Microsoft.AspNetCore.Components.Tests (1)
CascadingParameterStateTest.cs (1)
420return new ComponentState(new TestRenderer(), 0, component, parentComponentState);
140 references to ComponentState
Microsoft.AspNetCore.Components (81)
CascadingParameterState.cs (3)
28public static IReadOnlyList<CascadingParameterState> FindCascadingParameters(ComponentState componentState, out bool hasSingleDeliveryParameters) 77internal static ICascadingValueSupplier? GetMatchingCascadingValueSupplier(in CascadingParameterInfo info, Renderer renderer, ComponentState? componentState) 80var candidate = componentState;
CascadingValue.cs (5)
14private HashSet<ComponentState>? _subscribers; // Lazily instantiated 148void ICascadingValueSupplier.Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 157_subscribers ??= new HashSet<ComponentState>(); 161void ICascadingValueSupplier.Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 168foreach (var subscriber in _subscribers!)
CascadingValueSource.cs (5)
19private readonly ConcurrentDictionary<Dispatcher, List<ComponentState>>? _subscribers; 104: new ComponentState[subscribersCount]; 163void ICascadingValueSupplier.Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 172void ICascadingValueSupplier.Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 194private ComponentState _values;
ICascadingValueSupplier.cs (2)
16void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo); 18void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo);
Rendering\ComponentState.cs (8)
28/// Constructs an instance of <see cref="ComponentState"/>. 33/// <param name="parentComponentState">The <see cref="ComponentState"/> for the parent component, or null if this is a root component.</param> 34public ComponentState(Renderer renderer, int componentId, IComponent component, ComponentState? parentComponentState) 54private static ComponentState? GetSectionOutletLogicalParent(Renderer renderer, SectionOutlet sectionOutlet) 77/// Gets the <see cref="ComponentState"/> of the parent component, or null if this is a root component. 79public ComponentState? ParentComponentState { get; } 82/// Gets the <see cref="ComponentState"/> of the logical parent component, or null if this is a root component. 84public ComponentState? LogicalParentComponentState { get; }
Rendering\RenderQueueEntry.cs (2)
11public readonly ComponentState ComponentState; 14public RenderQueueEntry(ComponentState componentState, RenderFragment renderFragment)
RenderTree\Renderer.cs (42)
29private readonly Dictionary<int, ComponentState> _componentStateById = new Dictionary<int, ComponentState>(); 30private readonly Dictionary<IComponent, ComponentState> _componentStateByComponent = new Dictionary<IComponent, ComponentState>(); 130/// Gets the <see cref="ComponentState"/> associated with the specified component. 133/// <returns>The corresponding <see cref="ComponentState"/>.</returns> 134protected ComponentState GetComponentState(int componentId) 153protected internal ComponentState GetComponentState(IComponent component) 185var componentState = GetRequiredComponentState(componentId); 275var componentState = GetRequiredRootComponentState(componentId); 368private ComponentState AttachAndInitComponent(IComponent component, int parentComponentId) 371var parentComponentState = GetOptionalComponentState(parentComponentId); 372var componentState = CreateComponentState(componentId, component, parentComponentState); 381/// Creates a <see cref="ComponentState"/> instance to track state associated with a newly-instantiated component. 383/// may override this method to use their own subclasses of <see cref="ComponentState"/>. 387/// <param name="parentComponentState">The <see cref="ComponentState"/> associated with the parent component, or null if this is a root component.</param> 388/// <returns>A <see cref="ComponentState"/> for the new component.</returns> 389protected virtual ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState) 454ComponentState? receiverComponentState = null; 524internal ComponentState InstantiateChildComponentOnFrame(RenderTreeFrame[] frames, int frameIndex, int parentComponentId) 542var newComponentState = AttachAndInitComponent(newComponent, parentComponentId); 573internal void AddToPendingTasksWithErrorHandling(Task task, ComponentState? owningComponentState) 605/// <param name="componentState">The <see cref="ComponentState"/> for the component associated with this pending task, if any.</param> 607protected virtual void AddPendingTask(ComponentState? componentState, Task task) 657var componentState = GetOptionalComponentState(componentId); 702private ComponentState GetRequiredComponentState(int componentId) 703=> _componentStateById.TryGetValue(componentId, out var componentState) 707private ComponentState? GetOptionalComponentState(int componentId) 708=> _componentStateById.TryGetValue(componentId, out var componentState) 712private ComponentState GetRequiredRootComponentState(int componentId) 714var componentState = GetRequiredComponentState(componentId); 839var componentState = GetOptionalComponentState(array[i].ComponentId); 874var componentState = GetOptionalComponentState(array[i]); 888private void NotifyRenderCompleted(ComponentState state, ref List<Task> batch) 923var componentState = renderQueueEntry.ComponentState; 942var disposeComponentState = GetRequiredComponentState(disposeComponentId); 1042private async Task GetErrorHandledTask(Task taskToHandle, ComponentState? owningComponentState) 1060var componentState = GetOptionalComponentState(fieldInfo.ComponentId); 1077private void HandleExceptionViaErrorBoundary(Exception error, ComponentState? errorSourceOrNull) 1093var candidate = errorSourceOrNull; 1175foreach (var componentState in _componentStateById.Values)
RenderTree\Renderer.Log.cs (4)
19public static void InitializingComponent(ILogger logger, ComponentState componentState, ComponentState parentComponentState) 37public static void RenderingComponent(ILogger logger, ComponentState componentState) 48public static void DisposingComponent(ILogger logger, ComponentState componentState)
RenderTree\RenderTreeDiffBuilder.cs (2)
697var componentState = oldFrame.ComponentStateField; 963var childComponentState = diffContext.Renderer.InstantiateChildComponentOnFrame(frames, frameIndex, parentComponentId);
RenderTree\RenderTreeFrame.cs (4)
145[FieldOffset(24)] internal ComponentState ComponentStateField; 177internal ComponentState ComponentState => ComponentStateField; 316private RenderTreeFrame(int sequence, int componentSubtreeLength, [DynamicallyAccessedMembers(LinkerFlags.Component)] Type componentType, ComponentState componentState, object componentKey) 432internal RenderTreeFrame WithComponent(ComponentState componentState)
Routing\SupplyParameterFromQueryValueProvider.cs (4)
14private HashSet<ComponentState>? _subscribers; 15private HashSet<ComponentState>? _pendingSubscribers; 35public void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 51public void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo)
Microsoft.AspNetCore.Components.Authorization.Tests (3)
src\Components\Shared\test\TestRenderer.cs (3)
138protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState parentComponentState) 155public TestRendererComponentState(Renderer renderer, int componentId, IComponent component, ComponentState parentComponentState)
Microsoft.AspNetCore.Components.Endpoints (11)
Rendering\EndpointComponentState.cs (1)
19public EndpointComponentState(Renderer renderer, int componentId, IComponent component, ComponentState? parentComponentState)
Rendering\EndpointHtmlRenderer.cs (3)
147protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState) 156protected override void AddPendingTask(ComponentState? componentState, Task task)
Rendering\EndpointHtmlRenderer.EventDispatch.cs (2)
192for (var current = GetComponentState(componentId); current != null; current = current.ParentComponentState) 201static string GetName(ComponentState current) => current.Component.GetType().Name;
Rendering\EndpointHtmlRenderer.Prerendering.cs (4)
45var componentState = GetComponentState(component); 58var componentState = GetComponentState(componentId); 62private static SSRRenderModeBoundary? GetClosestRenderModeBoundary(ComponentState componentState) 64var currentComponentState = componentState;
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
193var componentState = GetComponentState(componentId);
Microsoft.AspNetCore.Components.Endpoints.Tests (3)
ImportMapTest.cs (3)
347protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState parentComponentState) 364public TestRendererComponentState(Renderer renderer, int componentId, IComponent component, ComponentState parentComponentState)
Microsoft.AspNetCore.Components.Forms.Tests (3)
src\Components\Shared\test\TestRenderer.cs (3)
138protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState parentComponentState) 155public TestRendererComponentState(Renderer renderer, int componentId, IComponent component, ComponentState parentComponentState)
Microsoft.AspNetCore.Components.Server.Tests (7)
Circuits\CircuitHostTest.cs (6)
431var componentState = ((TestRemoteRenderer)circuitHost.Renderer).GetTestComponentState(0); 457var componentState = ((TestRemoteRenderer)circuitHost.Renderer).GetTestComponentState(0); 484var componentState = ((TestRemoteRenderer)circuitHost.Renderer).GetTestComponentState(1); 518var componentState = ((TestRemoteRenderer)circuitHost.Renderer).GetTestComponentState(0); 555var componentState = ((TestRemoteRenderer)circuitHost.Renderer).GetTestComponentState(0); 720public ComponentState GetTestComponentState(int id)
Circuits\RemoteRendererTest.cs (1)
720public new ComponentState GetComponentState(int componentId)
Microsoft.AspNetCore.Components.Tests (20)
CascadingParameterStateTest.cs (9)
16var componentState = CreateComponentState(new ComponentWithNoParams()); 29var componentState = CreateComponentState(new ComponentWithNoCascadingParams()); 42var componentState = CreateComponentState(new ComponentWithCascadingParams()); 403static ComponentState[] CreateAncestry(params IComponent[] components) 405var result = new ComponentState[components.Length]; 417static ComponentState CreateComponentState( 418IComponent component, ComponentState parentComponentState = null) 492public void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 495public void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo)
CascadingParameterTest.cs (4)
891public void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 894public void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 1061void ICascadingValueSupplier.Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 1066void ICascadingValueSupplier.Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo)
ParameterViewTest.Assignment.cs (2)
798public void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 803public void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo)
ParameterViewTest.cs (2)
615public void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 618public void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo)
src\Components\Shared\test\TestRenderer.cs (3)
138protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState parentComponentState) 155public TestRendererComponentState(Renderer renderer, int componentId, IComponent component, ComponentState parentComponentState)
Microsoft.AspNetCore.Components.Web (7)
Forms\Editor.cs (2)
64void ICascadingValueSupplier.Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 69void ICascadingValueSupplier.Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo)
Forms\Mapping\FormMappingScope.cs (2)
89void ICascadingValueSupplier.Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 92void ICascadingValueSupplier.Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo)
Forms\Mapping\SupplyParameterFromFormValueProvider.cs (2)
66void ICascadingValueSupplier.Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 69void ICascadingValueSupplier.Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo)
HtmlRendering\StaticHtmlRenderer.HtmlWriting.cs (1)
249var componentState = GetComponentState(forComponentId);
Microsoft.AspNetCore.Components.Web.Tests (5)
Forms\Mapping\SupplyParameterFromFormTest.cs (2)
22var formComponentState = renderer.GetComponentState(formComponent); 50var formComponentState = renderer.Batches.Single()
src\Components\Shared\test\TestRenderer.cs (3)
138protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState parentComponentState) 155public TestRendererComponentState(Renderer renderer, int componentId, IComponent component, ComponentState parentComponentState)