Table of Contents

Class SettingsGlobalFileName

Namespace
CADability
Assembly
CADability.dll

Lets the application control where the global settings (GlobalSettings) are stored: attach a handler to GetGlobalSettingsFileName before the settings are first used to provide the file name, set neverSaveGlobalSettings to suppress saving, or set neverLoadGlobalSettings to start with default settings instead of reading the file, e.g. when the application stores the settings itself. Without a handler the file "CADability.GlobalSettings.json" in the current directory is used if it exists there and the directory is writable, otherwise the same file in the local application data folder (or in "My Documents" if that is not available).

public class SettingsGlobalFileName
Inheritance
SettingsGlobalFileName
Inherited Members

Constructors

SettingsGlobalFileName()

public SettingsGlobalFileName()

Fields

neverLoadGlobalSettings

When true, the global settings are not read from the global settings file when Settings is first used; it starts with default settings instead. Set it before the first access to Settings, because that access loads the settings. Default is false.

public static bool neverLoadGlobalSettings

Field Value

bool

neverSaveGlobalSettings

When true, SaveGlobalSettings() does nothing, so the global settings are never written to disk, e.g. for tests or when running from a read-only location. Default is false.

public static bool neverSaveGlobalSettings

Field Value

bool

Events

GetGlobalSettingsFileName

Queried for the name of the global settings file when the global settings are loaded or saved. Attach a handler before Settings is first used (the first access loads the settings), e.g. at application start. If no handler is attached or it returns null, the default location is used (see the class description).

public static event SettingsGlobalFileName.GetGlobalSettingsFileNameDelegate GetGlobalSettingsFileName

Event Type

SettingsGlobalFileName.GetGlobalSettingsFileNameDelegate