8 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.Server (1)
Circuits\RemoteComponentState.cs (1)
11internal sealed class RemoteComponentState : ComponentState
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
Microsoft.AspNetCore.Components.WebAssembly (1)
Rendering\WebAssemblyComponentState.cs (1)
11internal sealed class WebAssemblyComponentState : ComponentState
5 instantiations of ComponentState
Microsoft.AspNetCore.Components (1)
RenderTree\Renderer.cs (1)
410=> 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 (3)
CascadingParameterStateTest.cs (1)
420return new ComponentState(new TestRenderer(), 0, component, parentComponentState);
SupplyParameterFromPersistentComponentStateValueProviderTests.cs (2)
600var parentComponentState = parentComponent != null ? new ComponentState(renderer, i++, parentComponent, null) : null; 605var componentState = new ComponentState(renderer, i++, component, parentComponentState);
190 references to ComponentState
Microsoft.AspNetCore.Components (96)
CascadingParameterState.cs (3)
27public static IReadOnlyList<CascadingParameterState> FindCascadingParameters(ComponentState componentState, out bool hasSingleDeliveryParameters) 76internal static ICascadingValueSupplier? GetMatchingCascadingValueSupplier(in CascadingParameterInfo info, Renderer renderer, ComponentState? componentState) 79var 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 (6)
19private readonly ConcurrentDictionary<Dispatcher, List<ComponentState>>? _subscribers; 104: new ComponentState[subscribersCount]; 109foreach (var subscriber in subscribersCopy) 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)
29/// Constructs an instance of <see cref="ComponentState"/>. 34/// <param name="parentComponentState">The <see cref="ComponentState"/> for the parent component, or null if this is a root component.</param> 35public ComponentState(Renderer renderer, int componentId, IComponent component, ComponentState? parentComponentState) 62private static ComponentState? GetSectionOutletLogicalParent(Renderer renderer, SectionOutlet sectionOutlet) 85/// Gets the <see cref="ComponentState"/> of the parent component, or null if this is a root component. 87public ComponentState? ParentComponentState { get; } 90/// Gets the <see cref="ComponentState"/> of the logical parent component, or null if this is a root component. 92public ComponentState? LogicalParentComponentState { get; }
Rendering\RenderQueueEntry.cs (2)
11public readonly ComponentState ComponentState; 14public RenderQueueEntry(ComponentState componentState, RenderFragment renderFragment)
RenderTree\Renderer.cs (43)
34private readonly Dictionary<int, ComponentState> _componentStateById = new Dictionary<int, ComponentState>(); 35private readonly Dictionary<IComponent, ComponentState> _componentStateByComponent = new Dictionary<IComponent, ComponentState>(); 146/// Gets the <see cref="ComponentState"/> associated with the specified component. 149/// <returns>The corresponding <see cref="ComponentState"/>.</returns> 150protected ComponentState GetComponentState(int componentId) 169protected internal ComponentState GetComponentState(IComponent component) 201var componentState = GetRequiredComponentState(componentId); 291var componentState = GetRequiredRootComponentState(componentId); 384private ComponentState AttachAndInitComponent(IComponent component, int parentComponentId) 387var parentComponentState = GetOptionalComponentState(parentComponentId); 388var componentState = CreateComponentState(componentId, component, parentComponentState); 394internal void RegisterComponentState(IComponent component, int componentId, ComponentState componentState) 401/// Creates a <see cref="ComponentState"/> instance to track state associated with a newly-instantiated component. 403/// may override this method to use their own subclasses of <see cref="ComponentState"/>. 407/// <param name="parentComponentState">The <see cref="ComponentState"/> associated with the parent component, or null if this is a root component.</param> 408/// <returns>A <see cref="ComponentState"/> for the new component.</returns> 409protected virtual ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState) 487ComponentState? receiverComponentState = null; 583internal ComponentState InstantiateChildComponentOnFrame(RenderTreeFrame[] frames, int frameIndex, int parentComponentId) 601var newComponentState = AttachAndInitComponent(newComponent, parentComponentId); 632internal void AddToPendingTasksWithErrorHandling(Task task, ComponentState? owningComponentState) 664/// <param name="componentState">The <see cref="ComponentState"/> for the component associated with this pending task, if any.</param> 666protected virtual void AddPendingTask(ComponentState? componentState, Task task) 716var componentState = GetOptionalComponentState(componentId); 761private ComponentState GetRequiredComponentState(int componentId) 762=> _componentStateById.TryGetValue(componentId, out var componentState) 766private ComponentState? GetOptionalComponentState(int componentId) 767=> _componentStateById.TryGetValue(componentId, out var componentState) 771private ComponentState GetRequiredRootComponentState(int componentId) 773var componentState = GetRequiredComponentState(componentId); 909var componentState = GetOptionalComponentState(array[i].ComponentId); 944var componentState = GetOptionalComponentState(array[i]); 958private void NotifyRenderCompleted(ComponentState state, ref List<Task> batch) 993var componentState = renderQueueEntry.ComponentState; 1013var disposeComponentState = GetRequiredComponentState(disposeComponentId); 1113private async Task GetErrorHandledTask(Task taskToHandle, ComponentState? owningComponentState) 1131var componentState = GetOptionalComponentState(fieldInfo.ComponentId); 1148private void HandleExceptionViaErrorBoundary(Exception error, ComponentState? errorSourceOrNull) 1164var candidate = errorSourceOrNull; 1246foreach (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 (6)
14private HashSet<ComponentState>? _subscribers; 15private HashSet<ComponentState>? _pendingSubscribers; 35public void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 51public void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 132foreach (var subscriber in _subscribers) 142foreach (var subscriber in _pendingSubscribers)
SupplyParameterFromPersistentComponentStateValueProvider.cs (11)
23private readonly Dictionary<ComponentState, PersistingComponentStateSubscription> _subscriptions = []; 27internal Dictionary<ComponentState, PersistingComponentStateSubscription> Subscriptions => _subscriptions; 42var componentState = (ComponentState)key!; 51public void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 93public void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 103internal static string ComputeKey(ComponentState componentState, string propertyName) 129private static string ComputeFinalKey(byte[] preKey, ComponentState componentState) 224private static object? GetSerializableKey(ComponentState componentState) 235private static string GetComponentType(ComponentState componentState) => componentState.Component.GetType().FullName!; 237private static string GetParentComponentType(ComponentState componentState)
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 (13)
Rendering\EndpointComponentState.cs (1)
19public EndpointComponentState(Renderer renderer, int componentId, IComponent component, ComponentState? parentComponentState)
Rendering\EndpointHtmlRenderer.cs (3)
159protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState) 168protected override void AddPendingTask(ComponentState? componentState, Task task)
Rendering\EndpointHtmlRenderer.EventDispatch.cs (2)
258for (var current = GetComponentState(componentId); current != null; current = current.ParentComponentState) 267static string GetName(ComponentState current) => current.Component.GetType().Name;
Rendering\EndpointHtmlRenderer.Prerendering.cs (6)
47var componentState = GetComponentState(component); 60var componentState = GetComponentState(componentId); 64private static SSRRenderModeBoundary? GetClosestRenderModeBoundary(ComponentState componentState) 66var currentComponentState = componentState; 302internal (int sequence, object? key) GetSequenceAndKey(ComponentState boundaryComponentState) 320var targetState = boundaryComponentState.ParentComponentState;
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
195var 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 (3)
Circuits\RemoteComponentState.cs (1)
19ComponentState? parentComponentState)
Circuits\RemoteRenderer.cs (2)
317protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState)
Microsoft.AspNetCore.Components.Server.Tests (7)
Circuits\CircuitHostTest.cs (6)
540var componentState = ((TestRemoteRenderer)circuitHost.Renderer).GetTestComponentState(0); 566var componentState = ((TestRemoteRenderer)circuitHost.Renderer).GetTestComponentState(0); 593var componentState = ((TestRemoteRenderer)circuitHost.Renderer).GetTestComponentState(1); 627var componentState = ((TestRemoteRenderer)circuitHost.Renderer).GetTestComponentState(0); 664var componentState = ((TestRemoteRenderer)circuitHost.Renderer).GetTestComponentState(0); 829public ComponentState GetTestComponentState(int id)
Circuits\RemoteRendererTest.cs (1)
720public new ComponentState GetComponentState(int componentId)
Microsoft.AspNetCore.Components.Tests (47)
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)
SupplyParameterFromPersistentComponentStateValueProviderTests.cs (27)
33var componentState = componentStates.First(); 37new List<(ComponentState, string, string)> 60var componentState = componentStates.First(); 82var componentState = componentStates.First(); 108var componentState = componentStates.First(); 147var componentState = componentStates.First(); 186var componentState1 = componentStates.First(); 187var componentState2 = componentStates.Last(); 259var componentState1 = componentStates.First(); 260var componentState2 = componentStates.Last(); 304var componentState1 = componentStates.First(); 305var componentState2 = componentStates.Last(); 345var componentState1 = componentStates.First(); 346var componentState2 = componentStates.Last(); 378var componentState1 = componentStates.First(); 379var componentState2 = componentStates.Last(); 418var componentState1 = componentStates.First(); 419var componentState2 = componentStates.Last(); 448var componentState = componentStates.First(); 483var componentState = componentStates.First(); 518var componentState = componentStates.First(); 553var componentState = componentStates.First(); 575private static void InitializeState(PersistentComponentState state, List<(ComponentState componentState, string propertyName, string value)> items) 594private static List<ComponentState> CreateComponentState( 600var parentComponentState = parentComponent != null ? new ComponentState(renderer, i++, parentComponent, null) : null; 602var result = new List<ComponentState>(); 605var componentState = new ComponentState(renderer, i++, component, 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)
Microsoft.AspNetCore.Components.WebAssembly (3)
Rendering\WebAssemblyComponentState.cs (1)
19ComponentState? parentComponentState)
Rendering\WebAssemblyRenderer.cs (2)
195protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState)