3 types derived from ComponentState
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\EndpointComponentState.cs (1)
17internal 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)
451=> new ComponentState(this, componentId, component, parentComponentState);
137 references to ComponentState
Microsoft.AspNetCore.Components (108)
CascadingParameterState.cs (3)
38public static IReadOnlyList<CascadingParameterState> FindCascadingParameters(ComponentState componentState, out bool hasSingleDeliveryParameters) 87internal static ICascadingValueSupplier? GetMatchingCascadingValueSupplier(in CascadingParameterInfo info, Renderer renderer, ComponentState? componentState) 90var 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 (3)
27void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo); 29void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo, CascadingParameterSubscriptionMode mode) 32void Unsubscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo);
PersistentState\PersistentStateValueProvider.cs (6)
31var componentState = (ComponentState)key!; 41public void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo) 45ComponentState subscriber, 50private void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo, bool preserveCurrentValue) 71public 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) 145private static object? GetSerializableKey(ComponentState componentState) 156private static string GetComponentType(ComponentState componentState) => componentState.Component.GetType().FullName!; 158private static string GetParentComponentType(ComponentState componentState)
PersistentState\PersistentValueProviderComponentSubscription.cs (2)
37private readonly ComponentState _subscriber; 53ComponentState subscriber,
Rendering\ComponentState.cs (8)
30/// Constructs an instance of <see cref="ComponentState"/>. 35/// <param name="parentComponentState">The <see cref="ComponentState"/> for the parent component, or null if this is a root component.</param> 36public ComponentState(Renderer renderer, int componentId, IComponent component, ComponentState? parentComponentState) 63private static ComponentState? GetSectionOutletLogicalParent(Renderer renderer, SectionOutlet sectionOutlet) 86/// Gets the <see cref="ComponentState"/> of the parent component, or null if this is a root component. 88public ComponentState? ParentComponentState { get; } 91/// Gets the <see cref="ComponentState"/> of the logical parent component, or null if this is a root component. 93public ComponentState? LogicalParentComponentState { get; }
Rendering\RenderQueueEntry.cs (2)
11public readonly ComponentState ComponentState; 14public RenderQueueEntry(ComponentState componentState, RenderFragment renderFragment)
RenderTree\Renderer.cs (43)
35private readonly Dictionary<int, ComponentState> _componentStateById = new Dictionary<int, ComponentState>(); 36private readonly Dictionary<IComponent, ComponentState> _componentStateByComponent = new Dictionary<IComponent, ComponentState>(); 179/// Gets the <see cref="ComponentState"/> associated with the specified component. 182/// <returns>The corresponding <see cref="ComponentState"/>.</returns> 183protected ComponentState GetComponentState(int componentId) 202protected internal ComponentState GetComponentState(IComponent component) 236var componentState = GetRequiredComponentState(componentId); 332var componentState = GetRequiredRootComponentState(componentId); 425private ComponentState AttachAndInitComponent(IComponent component, int parentComponentId) 428var parentComponentState = GetOptionalComponentState(parentComponentId); 429var componentState = CreateComponentState(componentId, component, parentComponentState); 435internal void RegisterComponentState(IComponent component, int componentId, ComponentState componentState) 442/// Creates a <see cref="ComponentState"/> instance to track state associated with a newly-instantiated component. 444/// may override this method to use their own subclasses of <see cref="ComponentState"/>. 448/// <param name="parentComponentState">The <see cref="ComponentState"/> associated with the parent component, or null if this is a root component.</param> 449/// <returns>A <see cref="ComponentState"/> for the new component.</returns> 450protected virtual ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState) 528ComponentState? receiverComponentState = null; 624internal ComponentState InstantiateChildComponentOnFrame(RenderTreeFrame[] frames, int frameIndex, int parentComponentId) 642var newComponentState = AttachAndInitComponent(newComponent, parentComponentId); 673internal void AddToPendingTasksWithErrorHandling(Task task, ComponentState? owningComponentState) 705/// <param name="componentState">The <see cref="ComponentState"/> for the component associated with this pending task, if any.</param> 707protected virtual void AddPendingTask(ComponentState? componentState, Task task) 757var componentState = GetOptionalComponentState(componentId); 802internal ComponentState GetRequiredComponentState(int componentId) 803=> _componentStateById.TryGetValue(componentId, out var componentState) 807private ComponentState? GetOptionalComponentState(int componentId) 808=> _componentStateById.TryGetValue(componentId, out var componentState) 812private ComponentState GetRequiredRootComponentState(int componentId) 814var componentState = GetRequiredComponentState(componentId); 950var componentState = GetOptionalComponentState(array[i].ComponentId); 985var componentState = GetOptionalComponentState(array[i]); 999private void NotifyRenderCompleted(ComponentState state, ref List<Task> batch) 1034var componentState = renderQueueEntry.ComponentState; 1054var disposeComponentState = GetRequiredComponentState(disposeComponentId); 1154private async Task GetErrorHandledTask(Task taskToHandle, ComponentState? owningComponentState) 1172var componentState = GetOptionalComponentState(fieldInfo.ComponentId); 1189private void HandleExceptionViaErrorBoundary(Exception error, ComponentState? errorSourceOrNull) 1205var candidate = errorSourceOrNull; 1287foreach (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 (16)
Rendering\EndpointComponentState.cs (2)
33public EndpointComponentState(Renderer renderer, int componentId, IComponent component, ComponentState? parentComponentState) 102private int FindSequenceInParent(ComponentState parentState, CacheView target)
Rendering\EndpointHtmlRenderer.cs (3)
173protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState) 182protected 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)
197var componentState = GetComponentState(componentId);
SessionCascadingValueSupplier.cs (1)
36ComponentState 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)
262protected override ComponentState CreateComponentState(int componentId, IComponent component, ComponentState? parentComponentState)