Share via


ConfigurationKeySet.enabled Method

Definition

Overloads

enabled(Int32, Boolean)
enabled(Int32)

Determines whether to enable or disable the object.

enabled(Int32, Boolean)

public:
 virtual bool enabled(int _configurationKeyId, bool _enable);
public virtual bool enabled (int _configurationKeyId, bool _enable);
abstract member enabled : int * bool -> bool
override this.enabled : int * bool -> bool
Public Overridable Function enabled (_configurationKeyId As Integer, _enable As Boolean) As Boolean

Parameters

_configurationKeyId
Int32

The value to which to set the state of the configuration key; optional.

_enable
Boolean

The value to which to set the state of the configuration key; optional.

Returns

Applies to

enabled(Int32)

Determines whether to enable or disable the object.

public:
 virtual bool enabled(int num1);
public virtual bool enabled (int num1);
abstract member enabled : int -> bool
override this.enabled : int -> bool
Public Overridable Function enabled (num1 As Integer) As Boolean

Parameters

num1
Int32

Returns

true if the object is enabled; otherwise, false.

Remarks

The enabled property allows controls to be enabled or disabled at run time. For example, you can disable objects that do not apply to the current state of the application. You can also disable a control that is used only for display purposes, such as an error message, which provides read-only information.

This example demonstrates the use of the ConfigurationKeySet.enabled method.

static void testConfigKey(Args _args) 
{ 
    ConfigurationKeySet configKey = new ConfigurationKeySet(); 
    configKey.loadSystemSetup(); 
    // Set the enable value to false. 
    configKey.enabled(configurationkeynum(RouteApprove), false); 
    SysDictConfigurationKey::save(configKey.pack()); 
    SysSecurity::reload(true); 
    print isConfigurationkeyEnabled(configurationkeynum(RouteApprove)); 
    // Set the enable value to true. 
    configKey.enabled(configurationkeynum(RouteApprove), true); 
    //Save the configuration key setup. 
    SysDictConfigurationKey::save(configKey.pack()); 
    SysSecurity::reload(true); 
    print isConfigurationkeyEnabled(configurationkeynum(RouteApprove)); 
    pause; 
}

Applies to