Nucleus .Net Core CMS

Configuration.ConfigurationFile Class

Namespace: Nucleus.Extensions.Configuration
Assembly: Nucleus.Extensions.dll
Configuration file manager.

Constructor

Nucleus.Extensions.Configuration.ConfigurationFile Constructor

Nucleus.Extensions.Configuration.ConfigurationFile (KnownConfigurationFiles configurationFile, String environmentName)
Opens the specified file.
Parameters
Name Type
configurationFile Nucleus.Extensions.Configuration.ConfigurationFile.KnownConfigurationFiles
environmentName String

Methods

GetSection (String[]) Method

GetSection (String[] keys)
Retrieve an existing section from the configuration file, or create the section if it does not exist.
Parameters
Name Type
keys String[]

GetArray (String[]) Method

GetArray (String[] keys)
Retrieve an existing section from the configuration file, or create the section if it does not exist.
Parameters
Name Type
keys String[]

GetSection (String) Method

GetSection (String key)
Retrieve an existing section from the configuration file.
Parameters
Name Type
key String

GetSection (JContainer,String) Method

GetSection (JContainer section, String key)
Retrieve an existing section from the configuration file, or create a new section if it does not exist.
Parameters
Name Type
section Newtonsoft.Json.Linq.JContainer
key String

GetObject (JObject,String) Method

GetObject (JObject section, String key)
Retrieve an existing section from the configuration file, or create a new section if it does not exist.
Parameters
Name Type
section Newtonsoft.Json.Linq.JObject
key String

GetObject (JArray,String,String) Method

GetObject (JArray section, String key, String value)
Retrieve an existing section from the configuration file, or create a new section if it does not exist.
Parameters
Name Type
section Newtonsoft.Json.Linq.JArray
key String
value String

GetToken (String) Method

GetToken (String path)
Retrieve a token from the specified section.
Parameters
Name Type
path String

GetToken (JObject,String) Method

GetToken (JObject section, String key)
Retrieve a token from the specified section.
Parameters
Name Type
section Newtonsoft.Json.Linq.JObject
key String

Set (JObject,String,Object) Method

Set (JObject section, String key, Object value)
Add or replace a value.
Parameters
Name Type
section Newtonsoft.Json.Linq.JObject
key String
value Object

Set (JArray,Object) Method

Set (JArray section, Object value)
Add or replace a value.
Parameters
Name Type
section Newtonsoft.Json.Linq.JArray
value Object

RemoveObject (JArray,String,String) Method

RemoveObject (JArray section, String key, String value)
Remove an existing section from the configuration file if a match exists.
Parameters
Name Type
section Newtonsoft.Json.Linq.JArray
key String
value String

CommitChanges

CommitChanges ()
Save changes.