Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SiliconStudio.Presentation.Settings.SettingsService Class Reference

A static class that manages settings loading and saving for an application. More...

Static Public Member Functions

static List< SettingsKeyGetAllSettingsKeys (bool includeNonEditable)
 Gets a list of all registered SettingsKey instances. More...
 
static SettingsProfile CreateSettingsProfile (bool setAsCurrent, SettingsProfile parent=null)
 Creates a new settings profile. More...
 
static SettingsProfile LoadSettingsProfile (UFile filePath, bool setAsCurrent, SettingsProfile parent=null)
 Loads a settings profile from the given file. More...
 
static void ReloadSettingsProfile (SettingsProfile profile)
 Reloads a profile from its file, updating the value that have changed. More...
 
static void UnloadSettingsProfile (SettingsProfile profile)
 Unloads a profile that was previously loaded. More...
 
static bool SaveSettingsProfile (SettingsProfile profile, UFile filePath)
 Saves the given settings profile to a file at the given path. More...
 
static SettingsKey GetSettingsKey (UFile name)
 Gets the settings key that matches the given name. More...
 
static void ClearSettings ()
 Clears the current settings, including registered SettingsKey and SettingsProfile instances. This method should be used only for tests. More...
 

Properties

static LoggerResult Logger [get, set]
 Gets the logger associated to the SettingsService. More...
 
static SettingsProfile CurrentProfile [get, set]
 Gets or sets the SettingsProfile that is currently active. More...
 
static IEnumerable
< SettingsProfile
Profiles [get]
 Gets the list of registered profiles. More...
 

Events

static EventHandler
< SettingsFileLoadedEventArgs
SettingsFileLoaded
 Raised when a settings file has been loaded. More...
 

Detailed Description

A static class that manages settings loading and saving for an application.

Definition at line 18 of file SettingsService.cs.

Member Function Documentation

static void SiliconStudio.Presentation.Settings.SettingsService.ClearSettings ( )
static

Clears the current settings, including registered SettingsKey and SettingsProfile instances. This method should be used only for tests.

Definition at line 255 of file SettingsService.cs.

static SettingsProfile SiliconStudio.Presentation.Settings.SettingsService.CreateSettingsProfile ( bool  setAsCurrent,
SettingsProfile  parent = null 
)
static

Creates a new settings profile.

Parameters
setAsCurrentIf true, the created profile will also be set as CurrentProfile.
parentThe parent profile of the settings to create. If null, a default profile will be used.
Returns
A new instance of the SettingsProfile class.

Definition at line 77 of file SettingsService.cs.

static List<SettingsKey> SiliconStudio.Presentation.Settings.SettingsService.GetAllSettingsKeys ( bool  includeNonEditable)
static

Gets a list of all registered SettingsKey instances.

Parameters
includeNonEditableInidcates whether to include or not settings key which have the SettingsKey.IsEditable property set to false.
Returns
A list of all registered SettingsKey instances.

Definition at line 66 of file SettingsService.cs.

static SettingsKey SiliconStudio.Presentation.Settings.SettingsService.GetSettingsKey ( UFile  name)
static

Gets the settings key that matches the given name.

Parameters
nameThe name of the settings property to fetch.
Returns
The settings key that matches the given name, or null.

Definition at line 245 of file SettingsService.cs.

static SettingsProfile SiliconStudio.Presentation.Settings.SettingsService.LoadSettingsProfile ( UFile  filePath,
bool  setAsCurrent,
SettingsProfile  parent = null 
)
static

Loads a settings profile from the given file.

Parameters
filePathThe path of the file from which to load settings.
setAsCurrentIf true, the loaded profile will also be set as CurrentProfile.
parentThe profile to use as parent for the loaded profile. If null, a default profile will be used.
Returns
true if settings were correctly loaded, false otherwise.

Definition at line 94 of file SettingsService.cs.

References SiliconStudio.Core.Yaml.YamlSerializer.Deserialize().

static void SiliconStudio.Presentation.Settings.SettingsService.ReloadSettingsProfile ( SettingsProfile  profile)
static

Reloads a profile from its file, updating the value that have changed.

Parameters
profileThe profile to reload.

Definition at line 149 of file SettingsService.cs.

References SiliconStudio.Core.Yaml.YamlSerializer.Deserialize().

static bool SiliconStudio.Presentation.Settings.SettingsService.SaveSettingsProfile ( SettingsProfile  profile,
UFile  filePath 
)
static

Saves the given settings profile to a file at the given path.

Parameters
profileThe profile to save.
filePathThe path of the file.
Returns
true if the file was correctly saved, false otherwise.

Definition at line 209 of file SettingsService.cs.

static void SiliconStudio.Presentation.Settings.SettingsService.UnloadSettingsProfile ( SettingsProfile  profile)
static

Unloads a profile that was previously loaded.

Parameters
profileThe profile to unload.

Definition at line 194 of file SettingsService.cs.

Property Documentation

SettingsProfile SiliconStudio.Presentation.Settings.SettingsService.CurrentProfile
staticgetset

Gets or sets the SettingsProfile that is currently active.

Definition at line 49 of file SettingsService.cs.

LoggerResult SiliconStudio.Presentation.Settings.SettingsService.Logger
staticgetset

Gets the logger associated to the SettingsService.

Definition at line 44 of file SettingsService.cs.

IEnumerable<SettingsProfile> SiliconStudio.Presentation.Settings.SettingsService.Profiles
staticget

Gets the list of registered profiles.

Definition at line 54 of file SettingsService.cs.

Event Documentation

EventHandler<SettingsFileLoadedEventArgs> SiliconStudio.Presentation.Settings.SettingsService.SettingsFileLoaded
static

Raised when a settings file has been loaded.

Definition at line 59 of file SettingsService.cs.


The documentation for this class was generated from the following file: