Class: DuSettings

DuSettings

A class to manage settings.
Warning: DuESF stores the settings in json files and needs the right to write files, but it does not check if it has write access on the files, you should check that first using methods specific to the host application.

new DuSettings(namespace, file)

D:/RxLab/src/RxOT/DuAEF/Duik/Duik_API/DuAEF_Duik_api.jsxinc, line 1880
Constructs a new DuSettings instance.
Name Type Default Description
namespace string DuESF.scriptName optional A namespace to group your settings.
file File | string Folder.myDocuments/namespace/namespace_settings.json optional The file to store the settings
Properties:
Name Type Description
namespace string A namespace to group your settings.
file File The file to store the settings
data Object The settings as a js object

Methods

load()

D:/RxLab/src/RxOT/DuAEF/Duik/Duik_API/DuAEF_Duik_api.jsxinc, line 1936
loads data from the settings file

reset()

D:/RxLab/src/RxOT/DuAEF/Duik/Duik_API/DuAEF_Duik_api.jsxinc, line 1985
Reset the settings to their default values (removes the settings file!)

save(){boolean}

D:/RxLab/src/RxOT/DuAEF/Duik/Duik_API/DuAEF_Duik_api.jsxinc, line 1952
Saves data to the file.
Warning: DuESF does not check if it has write access on the files, you should check that first using methods specific to the host application.
Returns:
Type Description
boolean true if the file has been correctly written

setFile(file)

D:/RxLab/src/RxOT/DuAEF/Duik/Duik_API/DuAEF_Duik_api.jsxinc, line 1970
Sets the file to be used to save the settings
Name Type Description
file File | string The file or path to the file