Table of Contents

Class ComponentExtensions

Namespace
Dynamicweb.CoreUI
Assembly
Dynamicweb.CoreUI.dll

Extensions for UiComponentBase.

public static class ComponentExtensions
Inheritance
ComponentExtensions
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 UiComponentBase

The component which is searched.

Returns

IReadOnlyCollection<TComponent>

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 TabContainer.

public static Tab? GetOrAddTab(this UiComponentBase component, string name)

Parameters

component UiComponentBase

The component to get or add the tab under.

name string

The name of the tab to get or add.

Returns

Tab

A Tab if possible; null otherwise.

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 UiComponentBase

The component which is searched.

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 UiComponentBase

The component which is searched.

Returns

bool

true if component or a child is TComponent; 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 UiComponentBase

The component which is searched.

result TComponent

When the method returns, contains either the first TComponent component or null.

Returns

bool

true if a component of type TComponent was found; false otherwise.

Type Parameters

TComponent

The type of the component to find.

To top