Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static method: bool LoadSettings<TSettings>(out TSettings, string, SettingsSerializer?)

Declaration

public static bool LoadSettings<TSettings>(
    out TSettings settings,
    string filename = null,
    SettingsSerializer? serializer = null
)

Summary

Loads settings into the specified class, or, if not available, creates a new instance of the class. See Remarks.

Generic type parameters

TSettings
  • Must derive from: RT.Util.SettingsBase.
  • Must have a default constructor.
This type parameter is not documented.

Parameters

out TSettingssettings Destination - the settings class will be placed here
stringfilename If specified, overrides the filename that is normally derived from the values specified in the SettingsAttribute on the settings class.
SettingsSerializer?serializer If specified, overrides the serializer specified in the SettingsAttribute on the settings class.

Returns

true if loaded an existing file, false if created a new one.

Remarks

If the settings file exists but can't be loaded, this function will automatically create a backup of the settings file. If the file is opened exclusively by other code, will retry reading from it for up to 1.5 seconds.