OpenTAP 9.27
API Reference
Public Member Functions | Static Public Member Functions | Properties | List of all members
OpenTap.EnabledIfAttribute Class Reference

Identifies settings, properties, or methods that should only be valid/enabled when another property or setting has a certain value. More...

Inherits Attribute.

Public Member Functions

 EnabledIfAttribute (string propertyName, params object[] propertyValues)
 Identifies settings, properties, or methods that are only valid/enabled when another property or setting has a certain value. More...
 

Static Public Member Functions

static bool IsEnabled (IMemberData property, object instance, out IMemberData dependentProp, out IComparable dependentValue, out bool hidden)
 Returns true if a member is enabled.
 
static bool IsEnabled (IMemberData property, object instance)
 Checks whether a given property is enabled according to the EnabledIfAttribute. More...
 

Properties

bool HideIfDisabled [getset]
 Gets or sets if the property should be hidden when disabled.
 
bool Flags [getset]
 Gets or sets if the enabling value is individual flags from an enum.
 
bool Invert [getset]
 Gets or sets if the value should enable or disable(inverted) the setting.
 
string PropertyName [get]
 Name of the property to enable. Must exactly match a name of a property in the current class.
 
IComparable[] PropertyValues [get]
 Value(s) the property must have for the item to be valid/enabled. If multiple values are specified, the item is enabled if just one value is equal. If no values are specified, 'true' is the assumed value.
 
object[] Values [get]
 Value(s) the property must have for the item to be valid/enabled. If multiple values are specified, the item is enabled if just one value is equal. If no values are specified, 'true' is the assumed value.
 

Detailed Description

Identifies settings, properties, or methods that should only be valid/enabled when another property or setting has a certain value.

Constructor & Destructor Documentation

◆ EnabledIfAttribute()

OpenTap.EnabledIfAttribute.EnabledIfAttribute ( string  propertyName,
params object[]  propertyValues 
)
inline

Identifies settings, properties, or methods that are only valid/enabled when another property or setting has a certain value.

Parameters
propertyNameName of the property to enable. Must exactly match a name of a property in the current class.
propertyValuesValue(s) the property must have for the item to be valid/enabled. If multiple values are specified, the item is enabled if just one value is equal. If no values are specified, 'true' is the assumed value.

Member Function Documentation

◆ IsEnabled()

static bool OpenTap.EnabledIfAttribute.IsEnabled ( IMemberData  property,
object  instance 
)
inlinestatic

Checks whether a given property is enabled according to the EnabledIfAttribute.

Parameters
instanceInstance that has property.
propertyProperty to be checked for if it is enabled.
Returns
True if property is enabled.

OpenTAP 9.27 API built Wed Nov 27 2024 13:14:45