9 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)
16internal 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.QuickGrid.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
9 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 (7)
CascadingParameterStateTest.cs (1)
420return new ComponentState(new TestRenderer(), 0, component, parentComponentState);
PersistentStateValueProviderKeyResolverTests.cs (2)
334var parentComponentState = parentComponent != null ? new ComponentState(renderer, i++, parentComponent, null) : null; 339var componentState = new ComponentState(renderer, i++, component, parentComponentState);
PersistentStateValueProviderTests.cs (2)
127var parentComponentState = parentComponent != null ? new ComponentState(renderer, i++, parentComponent, null) : null; 132var componentState = new ComponentState(renderer, i++, component, parentComponentState);
PersistentValueProviderComponentSubscriptionTests.cs (2)
472? new ComponentState(renderer, 1, parentComponent, null) 474var componentState = new ComponentState(renderer, 2, component, parentComponentState);
212 references to ComponentState
Microsoft.AspNetCore.Components (99)
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;
ComponentSubscriptionKey.cs (2)
10internal readonly struct ComponentSubscriptionKey(ComponentState subscriber, string propertyName) : IEquatable<ComponentSubscriptionKey> 12public ComponentState Subscriber { get; } = subscriber;
ICascadingValueSupplier.cs (2)
16void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo); 18void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo);
PersistentState\PersistentStateValueProvider.cs (4)
31var componentState = (ComponentState)key!; 41public void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 55public void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo)
PersistentState\PersistentStateValueProviderKeyResolver.cs (5)
33internal static string ComputeKey(ComponentState componentState, string propertyName) 59private static string ComputeFinalKey(byte[] preKey, ComponentState componentState) 154private static object? GetSerializableKey(ComponentState componentState) 165private static string GetComponentType(ComponentState componentState) => componentState.Component.GetType().FullName!; 167private static string GetParentComponentType(ComponentState componentState)
PersistentState\PersistentValueProviderComponentSubscription.cs (2)
37private readonly ComponentState _subscriber; 53ComponentState subscriber,
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); 761internal 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 (3)
697var componentState = oldFrame.ComponentStateField; 781var currentComponentState = renderer.GetRequiredComponentState(componentId); 1003var 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)
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)
29public EndpointComponentState(Renderer renderer, int componentId, IComponent component, ComponentState? parentComponentState)
Rendering\EndpointHtmlRenderer.cs (3)
160protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState) 169protected override void AddPendingTask(ComponentState? componentState, Task task)
Rendering\EndpointHtmlRenderer.EventDispatch.cs (2)
259for (var current = GetComponentState(componentId); current != null; current = current.ParentComponentState) 268static 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; 309internal (int sequence, object? key) GetSequenceAndKey(ComponentState boundaryComponentState) 327var 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.QuickGrid.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)
17ComponentState? 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); 918public ComponentState GetTestComponentState(int id)
Circuits\RemoteRendererTest.cs (1)
720public new ComponentState GetComponentState(int componentId)
Microsoft.AspNetCore.Components.Tests (63)
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)
PersistentStateValueProviderKeyResolverTests.cs (16)
67var componentState1 = componentStates[0]; 68var componentState2 = componentStates[1]; 122var componentState1 = componentStates[0]; 123var componentState2 = componentStates[1]; 173var componentState1 = componentStates[0]; 174var componentState2 = componentStates[1]; 225var componentState1 = componentStates[0]; 226var componentState2 = componentStates[1]; 263var componentState1 = componentStates[0]; 264var componentState2 = componentStates[1]; 302var componentState1 = componentStates[0]; 303var componentState2 = componentStates[1]; 328private static List<ComponentState> CreateComponentState( 334var parentComponentState = parentComponent != null ? new ComponentState(renderer, i++, parentComponent, null) : null; 336var result = new List<ComponentState>(); 339var componentState = new ComponentState(renderer, i++, component, parentComponentState);
PersistentStateValueProviderTests.cs (9)
29var componentState = componentStates.First(); 33new List<(ComponentState, string, string)> 62var componentState = componentStates.First(); 89var componentState = componentStates.First(); 102private static void InitializeState(PersistentComponentState state, List<(ComponentState componentState, string propertyName, string value)> items) 121private static List<ComponentState> CreateComponentState( 127var parentComponentState = parentComponent != null ? new ComponentState(renderer, i++, parentComponent, null) : null; 129var result = new List<ComponentState>(); 132var componentState = new ComponentState(renderer, i++, component, parentComponentState);
PersistentValueProviderComponentSubscriptionTests.cs (18)
27var componentState = CreateComponentState(renderer, component, null, null); 49var componentState = CreateComponentState(renderer, component, null, null); 73var componentState = CreateComponentState(renderer, component, null, null); 103var componentState = CreateComponentState(renderer, component, null, null); 133var componentState = CreateComponentState(renderer, component, null, null); 163var componentState = CreateComponentState(renderer, component, null, null); 193var componentState = CreateComponentState(renderer, component, null, null); 213var componentState = CreateComponentState(renderer, component, null, null); 255var componentState = renderer.GetComponentState(component); 300var componentState = CreateComponentState(renderer, component, null, null); 345var componentState = CreateComponentState(renderer, component, null, null); 404var componentState = CreateComponentState(renderer, component, null, null); 465private static ComponentState CreateComponentState( 471var parentComponentState = parentComponent != null 474var componentState = new ComponentState(renderer, 2, component, parentComponentState); 653var componentState = CreateComponentState(renderer, component, null, null); 676var componentState = CreateComponentState(renderer, component, null, null); 699var componentState = CreateComponentState(renderer, component, null, null);
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)
Microsoft.AspNetCore.Components.WebAssembly (3)
Rendering\WebAssemblyComponentState.cs (1)
19ComponentState? parentComponentState)
Rendering\WebAssemblyRenderer.cs (2)
220protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState)