ConvertBooleanToEnum

function ConvertBooleanToEnum<T = any>(value: boolean, trueValue: T, falseValue: T)

The function ConvertBooleanToEnum converts a Boolean value to the value of an enumerator.

Parameter

Name

Type

Description

value

boolean

The Boolean value to be converted. Only a binding makes sense at this point.

trueValue

T

The value to be returned if the Boolean value is true.

falseValue

T

The value to be returned if the Boolean value is false.

Return value

Type

Description

T

The value specified as trueValue or falseValue depending on the transferred Boolean value.

NuGet package: Beckhoff.TwinCAT.HMI.Functions

ConvertBooleanToEnum 1:

NuGet packages are available from version 1.12.

ConvertBooleanToEnum 2:

Available from 1.8