10 types derived from ComponentState
Microsoft.AspNetCore.Components.Authorization.Tests (1)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Components.Endpoints.Tests (2)
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)
215 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>();
159/// Gets the <see cref="ComponentState"/> associated with the specified component.
162/// <returns>The corresponding <see cref="ComponentState"/>.</returns>
163protected ComponentState GetComponentState(int componentId)
182protected internal ComponentState GetComponentState(IComponent component)
215var componentState = GetRequiredComponentState(componentId);
310var componentState = GetRequiredRootComponentState(componentId);
403private ComponentState AttachAndInitComponent(IComponent component, int parentComponentId)
406var parentComponentState = GetOptionalComponentState(parentComponentId);
407var componentState = CreateComponentState(componentId, component, parentComponentState);
413internal void RegisterComponentState(IComponent component, int componentId, ComponentState componentState)
420/// Creates a <see cref="ComponentState"/> instance to track state associated with a newly-instantiated component.
422/// may override this method to use their own subclasses of <see cref="ComponentState"/>.
426/// <param name="parentComponentState">The <see cref="ComponentState"/> associated with the parent component, or null if this is a root component.</param>
427/// <returns>A <see cref="ComponentState"/> for the new component.</returns>
428protected virtual ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState)
506ComponentState? receiverComponentState = null;
602internal ComponentState InstantiateChildComponentOnFrame(RenderTreeFrame[] frames, int frameIndex, int parentComponentId)
620var newComponentState = AttachAndInitComponent(newComponent, parentComponentId);
651internal void AddToPendingTasksWithErrorHandling(Task task, ComponentState? owningComponentState)
683/// <param name="componentState">The <see cref="ComponentState"/> for the component associated with this pending task, if any.</param>
685protected virtual void AddPendingTask(ComponentState? componentState, Task task)
735var componentState = GetOptionalComponentState(componentId);
780internal ComponentState GetRequiredComponentState(int componentId)
781=> _componentStateById.TryGetValue(componentId, out var componentState)
785private ComponentState? GetOptionalComponentState(int componentId)
786=> _componentStateById.TryGetValue(componentId, out var componentState)
790private ComponentState GetRequiredRootComponentState(int componentId)
792var componentState = GetRequiredComponentState(componentId);
928var componentState = GetOptionalComponentState(array[i].ComponentId);
963var componentState = GetOptionalComponentState(array[i]);
977private void NotifyRenderCompleted(ComponentState state, ref List<Task> batch)
1012var componentState = renderQueueEntry.ComponentState;
1032var disposeComponentState = GetRequiredComponentState(disposeComponentId);
1132private async Task GetErrorHandledTask(Task taskToHandle, ComponentState? owningComponentState)
1150var componentState = GetOptionalComponentState(fieldInfo.ComponentId);
1167private void HandleExceptionViaErrorBoundary(Exception error, ComponentState? errorSourceOrNull)
1183var candidate = errorSourceOrNull;
1265foreach (var componentState in _componentStateById.Values)
Microsoft.AspNetCore.Components.Authorization.Tests (3)
Microsoft.AspNetCore.Components.Endpoints (13)
Microsoft.AspNetCore.Components.Endpoints.Tests (6)
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)