Table of Contents

Method TryGetMemberValue

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

TryGetMemberValue<T>(Type?, object?, string, out T, T)

Gets property or field value using the specified object type (or instance) and property name. Type of the object or the object itself must be specified.

public static bool TryGetMemberValue<T>(Type? type, object? instance, string propName, out T result, T defValue = default)

Parameters

type Type

Type of the object with the property.

instance object

Instance which contains the property or field. Specify Null, for the static properties.

propName string

Property name.

result T

Property value.

defValue T

Default property value (used if member not found).

Returns

bool

Type Parameters

T

Type of result.