8 types derived from ComponentState
Microsoft.AspNetCore.Components.Authorization.Tests (1)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
Microsoft.AspNetCore.Components.Forms.Tests (1)
Microsoft.AspNetCore.Components.Server (1)
Microsoft.AspNetCore.Components.Tests (1)
Microsoft.AspNetCore.Components.Web.Tests (1)
Microsoft.AspNetCore.Components.WebAssembly (1)
5 instantiations of ComponentState
Microsoft.AspNetCore.Components (1)
Microsoft.AspNetCore.Components.Server.Tests (1)
Microsoft.AspNetCore.Components.Tests (3)
190 references to ComponentState
Microsoft.AspNetCore.Components (96)
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)
Microsoft.AspNetCore.Components.Authorization.Tests (3)
Microsoft.AspNetCore.Components.Endpoints (13)
Microsoft.AspNetCore.Components.Endpoints.Tests (3)
Microsoft.AspNetCore.Components.Forms.Tests (3)
Microsoft.AspNetCore.Components.Server (3)
Microsoft.AspNetCore.Components.Server.Tests (7)
Microsoft.AspNetCore.Components.Tests (47)
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)
Microsoft.AspNetCore.Components.Web.Tests (5)
Microsoft.AspNetCore.Components.WebAssembly (3)