Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Class: RT.Serialization.Settings.SettingsFileJson<TSettings>

Generic type parameters

TSettings
  • Must have a default constructor.
This type parameter is not documented.

Constructors

SettingsFileJson<TSettings>(string appName, SettingsLocation location = SettingsLocation.User, bool throwOnError = false, string suffix = ".Settings.xml", ClassifyOptions options = null)
This member is not documented.

Instance methods

string
PathCombine(params string[] paths)
Combines the directory containing this settings file with the specified path segments. Use this method to reference additional files relative to the settings directory with correct support for portable mode marker file.
bool
Save(bool? throwOnError = null)
Saves the settings object SettingsFile<TSettings>.Settings to the settings file. (see also remarks)
bool
Save(string filename, bool? throwOnError = null)
void Saves settings on a background thread after a short delay. See Remarks. (see also remarks)

Instance properties

object Take this lock before making changes to the SettingsFile<TSettings>.Settings object if you use SettingsFile<TSettings>.SaveInBackground(). See Remarks on SettingsFile<TSettings>.SaveInBackground() for specifics.
TimeSpan Determines the maximum frequency at which calls to SettingsFile<TSettings>.SaveInBackground() actually perform the (potentially expensive) save. The first background save is delayed by the amount specified here; subsequent background saves only update the object to be saved but do not postpone the save.
booltrue if a new default instance of the settings had to be constructed, otherwise false. When false it's guaranteed that the settings were successfully loaded from the settings file. When true, if throwOnError is true then it's guaranteed that the settings file was missing, but if throwOnError is false then it's not possible to determine whether the file was present or a loading error has occurred.
string Full path to the file from which the settings were loaded and to which they will be saved. This property is populated on load even if the settings file did not exist as this is the path to which settings will be saved by SettingsFile<TSettings>.Save(bool?).
TSettings Settings stored in this settings file. This property is automatically populated by the constructor, which loads the settings or constructs a new instance where necessary. Users should update this object as appropriate and call SettingsFile<TSettings>.Save(bool?) to persist the settings.
TimeSpan Specifies how long to keep retrying when settings cannot be saved due to a file sharing violation. Defaults to 5 seconds.

Static properties

TimeSpan Specifies how long to keep retrying when settings cannot be loaded due to a file sharing violation. Defaults to 5 seconds. See Remarks. (see also remarks)