PropertyAccessorGetStaticValueTProperty Method

Gets the strongly typed value of a static property. If the type of the property is not known at compile time the non-generic Set methods can be used.

Definition

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

Type Parameters

TProperty
The type of the property.

Return Value

TProperty
The value of the property.

Exceptions

InvalidOperationExceptionThis PropertyAccessor represents an instance property or a property of an open generic type.
ArgumentExceptionTProperty is invalid.
NotSupportedExceptionThis PropertyAccessor represents a write-only property or an indexed property with more than one parameter.
PlatformNotSupportedExceptionYou use the .NET Standard 2.0 build of KGySoft.CoreLibraries and this PropertyAccessor represents a ref property.

See Also