1 write to Component
Microsoft.AspNetCore.Components (1)
Rendering\ComponentState.cs (1)
39Component = component ?? throw new ArgumentNullException(nameof(component));
61 references to Component
Microsoft.AspNetCore.Components (34)
CascadingParameterState.cs (2)
29var componentType = componentState.Component.GetType(); 82if (candidate.Component is ICascadingValueSupplier valueSupplier && valueSupplier.CanSupplyValue(info))
ComponentSubscriptionKey.cs (1)
26=> $"{Subscriber.Component.GetType().Name}.{PropertyName}";
PersistentState\PersistentStateValueProviderKeyResolver.cs (4)
165private static string GetComponentType(ComponentState componentState) => componentState.Component.GetType().FullName!; 173if (componentState.ParentComponentState.Component == null) 181var parentRenderMode = renderer.GetComponentRenderMode(componentState.ParentComponentState.Component); 182var grandParentRenderMode = renderer.GetComponentRenderMode(componentState.ParentComponentState.ParentComponentState.Component);
PersistentState\PersistentValueProviderComponentSubscription.cs (7)
66_propertyGetter = _propertyGetterCache.GetOrAdd((subscriber.Component.GetType(), _propertyName), PropertyGetterFactory); 70subscriber.Renderer.GetComponentRenderMode(subscriber.Component)); 111var currentPropertyValue = _propertyGetter.GetValue(_subscriber.Component); 185var property = _propertyGetter.GetValue(_subscriber.Component); 188Log.SkippedPersistingNullValue(_logger, _storageKey, _propertyType.Name, _subscriber.Component.GetType().Name, _propertyName); 194Log.PersistingValueToState(_logger, _storageKey, _propertyType.Name, _subscriber.Component.GetType().Name, _propertyName); 203Log.PersistingValueToState(_logger, _storageKey, _propertyType.Name, _subscriber.Component.GetType().Name, _propertyName);
Rendering\ComponentState.cs (8)
41? (GetSectionOutletLogicalParent(renderer, (SectionOutlet)parentComponentState!.Component) ?? parentComponentState) 130_nextRenderTree.AssertTreeIsValid(Component); 148if (Component is IHandleAfterRender handlerAfterRender) 251setParametersAsyncTask = Component.SetParametersAsync(directAndCascadingParameters); 316if (Component is IAsyncDisposable asyncDisposable) 322(Component as IDisposable)?.Dispose(); 368!ReferenceEquals(Component, currentFrame.Component)) 382return $"ComponentId = {ComponentId}, Type = {Component.GetType().Name}, Disposed = {_componentWasDisposed}";
Rendering\RenderQueueEntry.cs (1)
22return $"ComponentId = {ComponentState.ComponentId}, Type = {ComponentState.Component.GetType().Name}";
RenderTree\Renderer.cs (4)
162=> GetComponentRenderMode(GetRequiredComponentState(componentId).Component); 336=> GetRequiredRootComponentState(componentId).Component.GetType(); 1051_componentStateByComponent.Remove(disposeComponentState.Component); 1167if (candidate.Component is IErrorBoundary errorBoundary)
RenderTree\Renderer.Log.cs (5)
25InitializingRootComponent(logger, componentState.ComponentId, componentState.Component.GetType()); 29InitializingChildComponent(logger, componentState.ComponentId, componentState.Component.GetType(), parentComponentState.ComponentId, parentComponentState.Component.GetType()); 41RenderingComponent(logger, componentState.ComponentId, componentState.Component.GetType()); 52DisposingComponent(logger, componentState.ComponentId, componentState.Component.GetType());
RenderTree\RenderTreeDiffBuilder.cs (1)
785var componentType = currentComponentState.Component.GetType();
RenderTree\RenderTreeFrame.cs (1)
189public IComponent Component => ComponentStateField?.Component;
Microsoft.AspNetCore.Components.Endpoints (5)
Rendering\EndpointComponentState.cs (1)
52if (ParentComponentState != null && ParentComponentState.Component is SSRRenderModeBoundary boundary)
Rendering\EndpointHtmlRenderer.EventDispatch.cs (1)
268static string GetName(ComponentState current) => current.Component.GetType().Name;
Rendering\EndpointHtmlRenderer.Prerendering.cs (2)
70if (currentComponentState.Component is SSRRenderModeBoundary boundary) 311if (boundaryComponentState is null || boundaryComponentState.Component is not SSRRenderModeBoundary boundary)
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
277if (componentState.Component is SSRRenderModeBoundary boundary)
Microsoft.AspNetCore.Components.Server (1)
Circuits\RemoteRenderer.cs (1)
85GetComponentState(componentId).Component.GetType();
Microsoft.AspNetCore.Components.Server.Tests (9)
Circuits\CircuitHostTest.cs (9)
541var component = Assert.IsType<DynamicallyAddedComponent>(componentState.Component); 567var component = Assert.IsType<DynamicallyAddedComponent>(componentState.Component); 594var component = Assert.IsType<DynamicallyAddedComponent>(componentState.Component); 628var component = Assert.IsType<DynamicallyAddedComponent>(componentState.Component); 665var component = Assert.IsType<DynamicallyAddedComponent>(componentState.Component); 767var dynamicallyAddedComponent1 = Assert.IsType<DynamicallyAddedComponent>(testRenderer.GetTestComponentState(3).Component); 770var dynamicallyAddedComponent2 = Assert.IsType<DynamicallyAddedComponent>(testRenderer.GetTestComponentState(2).Component); 779Assert.Equal("Replaced Component 1", Assert.IsType<DynamicallyAddedComponent>(testRenderer.GetTestComponentState(3).Component).Message); 780Assert.Equal("New Component 2", Assert.IsType<DynamicallyAddedComponent>(testRenderer.GetTestComponentState(2).Component).Message);
Microsoft.AspNetCore.Components.Tests (12)
CascadingParameterStateTest.cs (12)
85Assert.Same(states[1].Component, match.ValueSupplier); 108Assert.Same(states[3].Component, match.ValueSupplier); 113Assert.Same(states[1].Component, match.ValueSupplier); 134Assert.Same(states[0].Component, match.ValueSupplier); 139Assert.Same(states[1].Component, match.ValueSupplier); 158Assert.Same(states[0].Component, match.ValueSupplier); 177Assert.Same(states[0].Component, match.ValueSupplier); 211Assert.Same(states[0].Component, match.ValueSupplier); 305Assert.Same(states[0].Component, match.ValueSupplier); 328Assert.Same(states[2].Component, match.ValueSupplier); 333Assert.Same(states[3].Component, match.ValueSupplier); 354Assert.Same(states[1].Component, match.ValueSupplier);