2 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
1 instantiation of ComponentState
Microsoft.AspNetCore.Components (1)
RenderTree\Renderer.cs (1)
429=> new ComponentState(this, componentId, component, parentComponentState);
130 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>(); 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)
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)
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);