Class ComponentExtensions
- Namespace
- Dynamicweb.CoreUI
- Assembly
- Dynamicweb.CoreUI.dll
Extensions for Ui
- Inheritance
-
Component
Extensions
- Inherited Members
Methods
GetAll<TComponent>(UiComponentBase)
Searches the given component or its child components and returns all components of type TComponent
.
public static IReadOnlyCollection<TComponent> GetAll<TComponent>(this UiComponentBase component) where TComponent : UiComponentBase
Parameters
component
UiComponent Base The component which is searched.
Returns
- IRead
Only <TComponent>Collection All components that matches type
TComponent
.
Type Parameters
TComponent
The type of the components to find.
GetOrAddTab(UiComponentBase, string)
Gets or adds a tab with the given name if the given component wraps a Tab
Parameters
component
UiComponent Base The component to get or add the tab under.
name
stringThe name of the tab to get or add.
Returns
Get<TComponent>(UiComponentBase)
Searches the given component and its child components and returns the first component of type TComponent
.
public static TComponent? Get<TComponent>(this UiComponentBase component) where TComponent : UiComponentBase
Parameters
component
UiComponent Base The component which is searched.
Returns
- TComponent
The first component that matches type
TComponent
.
Type Parameters
TComponent
The type of the component to find.
Get<TComponent>(UiComponentBase, Func<TComponent, bool>)
Searches the given component and its child components and returns the first component of type TComponent
matching the given predicate.
public static TComponent? Get<TComponent>(this UiComponentBase component, Func<TComponent, bool> predicate) where TComponent : UiComponentBase
Parameters
component
UiComponent Base The component which is searched.
predicate
Func<TComponent, bool>The predicate to find the specific component.
Returns
- TComponent
The first component that matches type
TComponent
.
Type Parameters
TComponent
The type of the component to find.
Has<TComponent>(UiComponentBase)
Determines whether the given component or one of its child components is of type TComponent
.
public static bool Has<TComponent>(this UiComponentBase component) where TComponent : UiComponentBase
Parameters
component
UiComponent Base The component which is searched.
Returns
- bool
true
ifcomponent
or a child isTComponent
;false
otherwise.
Type Parameters
TComponent
The type of the component to find.
TryGet<TComponent>(UiComponentBase, out TComponent?)
Searches the given component or its child components and returns the first component of type TComponent
.
public static bool TryGet<TComponent>(this UiComponentBase component, out TComponent? result) where TComponent : UiComponentBase
Parameters
component
UiComponent Base The component which is searched.
result
TComponentWhen the method returns, contains either the first
TComponent
component ornull
.
Returns
- bool
true
if a component of typeTComponent
was found;false
otherwise.
Type Parameters
TComponent
The type of the component to find.