Partager via


SystemState.SetBoolean Method

Applies To: Windows 8.1

Sets specified system settings.

Namespace: Microsoft.Assessments.Runtime
Assembly: Microsoft.Assessments.Core (in Microsoft.Assessments.Core.dll)

Usage

'Usage
Dim instance As SystemState
Dim setting As SystemSetting
Dim enable As Boolean

instance.SetBoolean(setting, enable)

Syntax

'Declaration
Public Sub SetBoolean ( _
    setting As SystemSetting, _
    enable As Boolean _
)
public void SetBoolean (
    SystemSetting setting,
    bool enable
)
public:
void SetBoolean (
    SystemSetting setting, 
    bool enable
)
public void SetBoolean (
    SystemSetting setting, 
    boolean enable
)
public function SetBoolean (
    setting : SystemSetting, 
    enable : boolean
)

Parameters

  • setting
    The SystemSetting enumerator specifying which system setting to set. The enumerator must have the SystemSettingFlagSetBoolFalse or SystemSettingFlagSetBoolFalse bit set in it depending on the value of enabled passed in.
  • enable
    True if the specified setting is to be set to enable.

Remarks

When an assessment calls this method, the original value is stored in the state file that was created by ManageSystemState when this SystemState object was created. If the value of enabled does not match the SystemSettingFlagSetBoolFalse or SystemSettingFlagSetBoolTrue values in the SystemSetting bits set in the setting enumerator, an error will be returned.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows 8.1

See Also

Reference

SystemState Class
SystemState Members
Microsoft.Assessments.Runtime Namespace