Interface IComponentHost
Provides a collection of IComponent objects.
Namespace: SadConsole.Components
Assembly: SadConsole.dll
Syntax
public interface IComponentHost
Properties
SadComponents
A collection of components processed by this console.
Declaration
ObservableCollection<IComponent> SadComponents { get; }
Property Value
Type | Description |
---|---|
ObservableCollection<IComponent> |
Methods
CompareComponent(IComponent, IComponent)
Uses the SortOrder to compare the left
component with the right
component.
Declaration
public static int CompareComponent(IComponent left, IComponent right)
Parameters
Type | Name | Description |
---|---|---|
IComponent | left | The first component to compare. |
IComponent | right | The second component to compare. |
Returns
Type | Description |
---|---|
int | when the left sort order is greater than right ; when left is less than right ; when they are equal.
|
GetSadComponent<TComponent>()
Gets the first component of the specified type.
Declaration
TComponent? GetSadComponent<TComponent>() where TComponent : class, IComponent
Returns
Type | Description |
---|---|
TComponent | The component if found, otherwise null. |
Type Parameters
Name | Description |
---|---|
TComponent | The component to find. |
GetSadComponents<TComponent>()
Gets components of the specified types.
Declaration
IEnumerable<TComponent> GetSadComponents<TComponent>() where TComponent : class, IComponent
Returns
Type | Description |
---|---|
IEnumerable<TComponent> | The components found. |
Type Parameters
Name | Description |
---|---|
TComponent | The component to find |
HasSadComponent<TComponent>(out TComponent?)
Indicates whether or not the component exists in the SadComponents collection.
Declaration
bool HasSadComponent<TComponent>(out TComponent? component) where TComponent : class, IComponent
Parameters
Type | Name | Description |
---|---|---|
TComponent | component |
Returns
Type Parameters
Name | Description |
---|---|
TComponent | The component to find. |