Class ComponentCollection
Represents the collection of IAsyncComponent implementations.
Namespace: Umbraco.Cms.Core.Composing
Assembly: Umbraco.Core.dll
Syntax
public class ComponentCollection : BuilderCollectionBase<IAsyncComponent>, IBuilderCollection<IAsyncComponent>
Constructors
View SourceComponentCollection(Func<IEnumerable<IAsyncComponent>>, IProfilingLogger, ILogger<ComponentCollection>)
Initializes a new instance of the ComponentCollection class.
Declaration
public ComponentCollection(Func<IEnumerable<IAsyncComponent>> items, IProfilingLogger profilingLogger, ILogger<ComponentCollection> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IEnumerable<IAsyncComponent>> | items | A factory function that provides the component items. |
| IProfilingLogger | profilingLogger | The profiling logger for timing component operations. |
| ILogger<ComponentCollection> | logger | The logger for recording component lifecycle events. |
Methods
View SourceInitializeAsync(bool, CancellationToken)
Initializes all components in the collection.
Declaration
public Task InitializeAsync(bool isRestarting, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isRestarting | If set to |
| CancellationToken | cancellationToken | The cancellation token. Cancellation indicates that the start process has been aborted. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
TerminateAsync(bool, CancellationToken)
Terminates all components in the collection in reverse order.
Declaration
public Task TerminateAsync(bool isRestarting, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isRestarting | If set to |
| CancellationToken | cancellationToken | The cancellation token. Cancellation indicates that the shutdown process should no longer be graceful. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |