Class ScriptSettings
Inherited Members
Namespace: GTA
Assembly: ScriptHookVDotNet3.dll
Syntax
public sealed class ScriptSettings
Methods
| Improve this Doc View SourceGetAllValues<T>(String, String)
Reads all the values at a specified key and section from this ScriptSettings.
Declaration
public T[] GetAllValues<T>(string section, string name)
Parameters
Type | Name | Description |
---|---|---|
String | section | The section where the value is. |
String | name | The name of the key the values are saved at. |
Returns
Type | Description |
---|---|
T[] |
Type Parameters
Name | Description |
---|---|
T |
GetValue<T>(String, String, T)
Reads a value from this ScriptSettings.
Declaration
public T GetValue<T>(string section, string name, T defaultvalue)
Parameters
Type | Name | Description |
---|---|---|
String | section | The section where the value is. |
String | name | The name of the key the value is saved at. |
T | defaultvalue | The fall-back value if the key doesn't exist or casting to type |
Returns
Type | Description |
---|---|
T | The value at |
Type Parameters
Name | Description |
---|---|
T |
Load(String)
Loads a ScriptSettings from the specified file.
Declaration
public static ScriptSettings Load(string filename)
Parameters
Type | Name | Description |
---|---|---|
String | filename | The filename to load the settings from. |
Returns
Type | Description |
---|---|
ScriptSettings |
Save()
Saves this ScriptSettings to file.
Declaration
public bool Save()
Returns
Type | Description |
---|---|
Boolean | true if the file saved successfully; otherwise, false |
SetValue<T>(String, String, T)
Sets a value in this ScriptSettings.
Declaration
public void SetValue<T>(string section, string name, T value)
Parameters
Type | Name | Description |
---|---|---|
String | section | The section where the value is. |
String | name | The name of the key the value is saved at. |
T | value | The value to set the key to. |
Type Parameters
Name | Description |
---|---|
T |