9 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.QuickGrid.Tests (1)
Microsoft.AspNetCore.Components.Server (1)
Microsoft.AspNetCore.Components.Tests (1)
Microsoft.AspNetCore.Components.Web.Tests (1)
Microsoft.AspNetCore.Components.WebAssembly (1)
9 instantiations of ComponentState
Microsoft.AspNetCore.Components (1)
Microsoft.AspNetCore.Components.Server.Tests (1)
Microsoft.AspNetCore.Components.Tests (7)
212 references to ComponentState
Microsoft.AspNetCore.Components (99)
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)
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.QuickGrid.Tests (3)
Microsoft.AspNetCore.Components.Server (3)
Microsoft.AspNetCore.Components.Server.Tests (7)
Microsoft.AspNetCore.Components.Tests (63)
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);
Microsoft.AspNetCore.Components.Web (7)
Microsoft.AspNetCore.Components.Web.Tests (5)
Microsoft.AspNetCore.Components.WebAssembly (3)