C# Class Zazzles.Settings

显示文件 Open project: FOGProject/zazzles

Private Properties

Property Type Description
Save bool
SaveSession bool
Settings System

Public Methods

Method Description
Get ( string key ) : string

IsCompatible ( OSType type ) : bool

Check if the current OS is compatible with the given type

Reload ( ) : void

Reparse the settings.json file

Set ( string key, JToken value, bool session = true ) : void

Set the value of a setting. Will automatically save.

SetPath ( string filePath ) : void

Set the filePath of the settings.json file. Will automatically reload.

Private Methods

Method Description
Save ( ) : bool

Save the current data to settings.json

SaveSession ( ) : bool
Settings ( ) : System

Method Details

Get() public static method

public static Get ( string key ) : string
key string The setting to retrieve
return string

IsCompatible() public static method

Check if the current OS is compatible with the given type
public static IsCompatible ( OSType type ) : bool
type OSType The type of OS to check for compatibility with
return bool

Reload() public static method

Reparse the settings.json file
public static Reload ( ) : void
return void

Set() public static method

Set the value of a setting. Will automatically save.
public static Set ( string key, JToken value, bool session = true ) : void
key string The name of the setting
value JToken The new value of the setting
session bool
return void

SetPath() public static method

Set the filePath of the settings.json file. Will automatically reload.
public static SetPath ( string filePath ) : void
filePath string The path of the file
return void