FieldAccessorGetStaticValueTField Method

Gets the strongly typed value of a static field. If the type of the field is not known at compile time the non-generic Get method can be used.

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public TField GetStaticValue<TField>()

Type Parameters

TField
The type of the field.

Return Value

TField
The value of the field.

Exceptions

InvalidOperationExceptionThis FieldAccessor represents an instance field or a field of an open generic type.
ArgumentExceptionTField is invalid.
NotSupportedExceptionOn .NET Framework the code is executed in a partially trusted domain with insufficient permissions.

See Also