Table of Contents

Method GetStaticFields

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

GetStaticFields<TField>(Type, bool)

Retrieves all static fields of a specified type from a given container type.

public static IEnumerable<TField> GetStaticFields<TField>(Type containerType, bool includeNonPublic = false)

Parameters

containerType Type

The type that contains the static fields to search. Must not be null.

includeNonPublic bool

The bool value indicating whether to include non-public fields.

Returns

IEnumerable<TField>

An IEnumerable<T> containing all static fields of type TField defined in the specified containerType. Returns an empty collection if no matching fields are found.

Type Parameters

TField

The type of the static fields to retrieve.

Remarks

This method searches for static fields in the specified type and filters them by the specified field type. Only fields that are assignable to TField are included in the result.