Skip to content

IComponentHost Interface

Provides a collection of IComponent objects.

C#
public interface IComponentHost

A collection of components processed by this console.

C#
ObservableCollection<IComponent> SadComponents { get; }

Gets the first component of the specified type.

C#
TComponent? GetSadComponent<TComponent>() where TComponent : class, IComponent

TComponent
The component if found, otherwise null.

Gets components of the specified types.

C#
IEnumerable<TComponent> GetSadComponents<TComponent>() where TComponent : class, IComponent

IEnumerable<TComponent>
The components found.

HasSadComponent<TComponent>(out TComponent?)

Section titled “HasSadComponent<TComponent>(out TComponent?)”

Indicates whether or not the component exists in the SadComponents collection.

C#
bool HasSadComponent<TComponent>(out TComponent? component) where TComponent : class, IComponent

component TComponent

bool
true when the component exists; otherwise false.

Uses the SortOrder to compare the left component with the right component.

C#
public static int CompareComponent(IComponent left, IComponent right)

left IComponent
The first component to compare.

right IComponent
The second component to compare.

int

`1`
when the `left` sort order is greater than `right`;
`-1`
when `left` is less than `right`;
`0`
when they are equal.