NFive API Reference

NFive API Reference

    Show / Hide Table of Contents

    Class ConfigurationManager

    Utility helpers for generating and serializing plugin configuration files.

    Inheritance
    Object
    ConfigurationManager
    Namespace: NFive.SDK.Plugins.Configuration
    Assembly: NFive.SDK.Plugins.dll
    Syntax
    public static class ConfigurationManager

    Fields

    | Improve this Doc View Source

    ConfigurationPath

    The default path to the NFive configuration directory

    Declaration
    public const string ConfigurationPath = "config"
    Field Value
    Type Description
    String
    | Improve this Doc View Source

    DefinitionFile

    The default name of the NFive definition file.

    Declaration
    public const string DefinitionFile = "nfive.yml"
    Field Value
    Type Description
    String
    | Improve this Doc View Source

    LockFile

    The default name of the NFive lock file

    Declaration
    public const string LockFile = "nfive.lock"
    Field Value
    Type Description
    String
    | Improve this Doc View Source

    PluginPath

    The default path to the NFive plugins directory

    Declaration
    public const string PluginPath = "plugins"
    Field Value
    Type Description
    String
    | Improve this Doc View Source

    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 Source

    InitializeConfig(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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2018-2019 NFive