Class ConfigurationManager
Utility helpers for generating and serializing plugin configuration files.
Namespace: NFive.SDK.Plugins.Configuration
Assembly: NFive.SDK.Plugins.dll
Syntax
public static class ConfigurationManager
Fields
| Improve this Doc View SourceConfigurationPath
The default path to the NFive configuration directory
Declaration
public const string ConfigurationPath = "config"
Field Value
Type | Description |
---|---|
String |
DefinitionFile
The default name of the NFive definition file.
Declaration
public const string DefinitionFile = "nfive.yml"
Field Value
Type | Description |
---|---|
String |
LockFile
The default name of the NFive lock file
Declaration
public const string LockFile = "nfive.lock"
Field Value
Type | Description |
---|---|
String |
PluginPath
The default path to the NFive plugins directory
Declaration
public const string PluginPath = "plugins"
Field Value
Type | Description |
---|---|
String |
ResourceFile
The default name of the FiveM resource file
Declaration
public const string ResourceFile = "__resource.lua"
Field Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceInitializeConfig(Name, Type)
Generates and saves an initial configuration for the specified plugin.
Declaration
public static object InitializeConfig(Name plugin, Type type)
Parameters
Type | Name | Description |
---|---|---|
Name | plugin | Name of the plugin to generate configuration for. |
Type | type | The type of the configuration object. |
Returns
Type | Description |
---|---|
Object | The default configuration object. |
InitializeType(String, Type)
Generates and saves an initial configuration for the specified type.
Declaration
public static void InitializeType(string file, Type type)
Parameters
Type | Name | Description |
---|---|---|
String | file | The configuration file to deserialize. |
Type | type | The type of the configuration object. |
Load(Name, String, Type)
Deserializes the specified file, owned by the specified plugin, into the specified type.
Declaration
public static object Load(Name name, string file, Type type)
Parameters
Type | Name | Description |
---|---|---|
Name | name | The name of the plugin to look under. |
String | file | The file to deserialize under the plugin. |
Type | type | The type to deserialize as. |
Returns
Type | Description |
---|---|
Object | The deserialized object. |
Load(String, Type)
Deserializes the specified configuration file into the specified type.
Declaration
public static object Load(string path, Type type)
Parameters
Type | Name | Description |
---|---|---|
String | path | The configuration file to deserialize. |
Type | type | The type to deserialize as. |
Returns
Type | Description |
---|---|
Object | The deserialized object. |
Load<T>(String)
Deserializes the specified configuration file into the specified type.
Declaration
public static T Load<T>(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | The configuration file to deserialize. |
Returns
Type | Description |
---|---|
T | The deserialized object. |
Type Parameters
Name | Description |
---|---|
T | The type to deserialize as. |