3 types derived from ComponentState
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\EndpointComponentState.cs (1)
16internal sealed class EndpointComponentState : ComponentState
Microsoft.AspNetCore.Components.Server (1)
Circuits\RemoteComponentState.cs (1)
11internal sealed class RemoteComponentState : ComponentState
Microsoft.AspNetCore.Components.WebAssembly (1)
Rendering\WebAssemblyComponentState.cs (1)
11internal sealed class WebAssemblyComponentState : ComponentState
1 instantiation of ComponentState
Microsoft.AspNetCore.Components (1)
RenderTree\Renderer.cs (1)
444=> new ComponentState(this, componentId, component, parentComponentState);
133 references to ComponentState
Microsoft.AspNetCore.Components (105)
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;
CascadingParameterValueProvider.cs (5)
13private readonly Func<ComponentState, TAttribute, CascadingParameterInfo, CascadingParameterSubscription> _subscribeFactory; 15public CascadingParameterValueProvider(Func<ComponentState, TAttribute, CascadingParameterInfo, CascadingParameterSubscription> subscribeFactory) 27var subscriptionKey = new ComponentSubscriptionKey((ComponentState)key!, parameterInfo.PropertyName); 35public void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 41public void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo)
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!)
CascadingValueServiceCollectionExtensions.cs (1)
65Func<IServiceProvider, Func<ComponentState, TAttribute, CascadingParameterInfo, CascadingParameterSubscription>> subscribeFactory)
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>(); 173/// Gets the <see cref="ComponentState"/> associated with the specified component. 176/// <returns>The corresponding <see cref="ComponentState"/>.</returns> 177protected ComponentState GetComponentState(int componentId) 196protected internal ComponentState GetComponentState(IComponent component) 229var componentState = GetRequiredComponentState(componentId); 325var componentState = GetRequiredRootComponentState(componentId); 418private ComponentState AttachAndInitComponent(IComponent component, int parentComponentId) 421var parentComponentState = GetOptionalComponentState(parentComponentId); 422var componentState = CreateComponentState(componentId, component, parentComponentState); 428internal void RegisterComponentState(IComponent component, int componentId, ComponentState componentState) 435/// Creates a <see cref="ComponentState"/> instance to track state associated with a newly-instantiated component. 437/// may override this method to use their own subclasses of <see cref="ComponentState"/>. 441/// <param name="parentComponentState">The <see cref="ComponentState"/> associated with the parent component, or null if this is a root component.</param> 442/// <returns>A <see cref="ComponentState"/> for the new component.</returns> 443protected virtual ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState) 521ComponentState? receiverComponentState = null; 617internal ComponentState InstantiateChildComponentOnFrame(RenderTreeFrame[] frames, int frameIndex, int parentComponentId) 635var newComponentState = AttachAndInitComponent(newComponent, parentComponentId); 666internal void AddToPendingTasksWithErrorHandling(Task task, ComponentState? owningComponentState) 698/// <param name="componentState">The <see cref="ComponentState"/> for the component associated with this pending task, if any.</param> 700protected virtual void AddPendingTask(ComponentState? componentState, Task task) 750var componentState = GetOptionalComponentState(componentId); 795internal ComponentState GetRequiredComponentState(int componentId) 796=> _componentStateById.TryGetValue(componentId, out var componentState) 800private ComponentState? GetOptionalComponentState(int componentId) 801=> _componentStateById.TryGetValue(componentId, out var componentState) 805private ComponentState GetRequiredRootComponentState(int componentId) 807var componentState = GetRequiredComponentState(componentId); 943var componentState = GetOptionalComponentState(array[i].ComponentId); 978var componentState = GetOptionalComponentState(array[i]); 992private void NotifyRenderCompleted(ComponentState state, ref List<Task> batch) 1027var componentState = renderQueueEntry.ComponentState; 1047var disposeComponentState = GetRequiredComponentState(disposeComponentId); 1147private async Task GetErrorHandledTask(Task taskToHandle, ComponentState? owningComponentState) 1165var componentState = GetOptionalComponentState(fieldInfo.ComponentId); 1182private void HandleExceptionViaErrorBoundary(Exception error, ComponentState? errorSourceOrNull) 1198var candidate = errorSourceOrNull; 1280foreach (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; 36public void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 52public void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 122foreach (var subscriber in _subscribers) 132foreach (var subscriber in _pendingSubscribers)
Microsoft.AspNetCore.Components.Endpoints (15)
Rendering\EndpointComponentState.cs (1)
29public EndpointComponentState(Renderer renderer, int componentId, IComponent component, ComponentState? parentComponentState)
Rendering\EndpointHtmlRenderer.cs (3)
170protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState) 179protected 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; 286internal (int sequence, object? key) GetSequenceAndKey(ComponentState boundaryComponentState) 304var targetState = boundaryComponentState.ParentComponentState;
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
196var componentState = GetComponentState(componentId);
SessionCascadingValueSupplier.cs (1)
35ComponentState componentState,
TempData\TempDataCascadingValueSupplier.cs (1)
32ComponentState componentState,
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.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.WebAssembly (3)
Rendering\WebAssemblyComponentState.cs (1)
19ComponentState? parentComponentState)
Rendering\WebAssemblyRenderer.cs (2)
251protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState)