C# Class CustomConfigurations.Config

The Config class is a wrapper around the ConfigurationSectionLoader. It deals with creating and loading in the variables. It allows easier access to any Value for a given key. For a given key it will return NULL or the value if found.
Inheritance: IDisposable
Afficher le fichier Open project: twistedtwig/CustomConfigurations Class Usage Examples

Méthodes publiques

Méthode Description
Config ( ) : System

Default constructor will give a blank configuration path and section, it will try and determine a the config path and choose the first valid section it can find.

Config ( bool allowValueInheritance ) : System
Config ( string configurationPath, bool allowValueInheritance = true ) : System

Constructor with the full configuration path given.

Config ( string pathToConfigFile, string configurationPath ) : System

Constructor with the full configuration path given.

Config ( string pathToConfigFile, string configurationPath, bool allowValueInheritance ) : System
ContainsKey ( string sectionName ) : bool

Determines if the loader has a config section by the given name.

CreateConfigKey ( ) : void
DecryptConfigurationSection ( ) : void
DecryptConfigurationSection ( string sectionName ) : void
DecryptConfigurationSection ( string configPath, string sectionName ) : void

This method is used to decrypt the particular section of the application config

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

EncryptConfigurationSection ( ) : void
EncryptConfigurationSection ( string sectionName ) : void
GetSection ( string sectionName ) : ConfigSection

Get the config section by the name attribute.

Private Methods

Méthode Description
CreateConfigurationLoaderObject ( string pathToConfigFile, string configPath, bool allowValueInheritance ) : bool

creates the configurationLoader for the given path.

DetermineConfigurationPath ( string pathToConfigFile ) : IEnumerable

Tries to find all valid configuration section / group paths that are valid for this loader.

DetermineValidSectionElements ( Regex configRegex, string parentSection, XPathNodeIterator parentGroupIterator ) : IEnumerable

Looks at the given iterator and tries to find any valid section groups that match the regex given for the config transform type.

DetermineValidSectionGroups ( Regex configRegex, XPathNodeIterator sectionGroupIterator ) : IEnumerable

tries to find any valid section groups which contain the correct section to match the regex given for the transform type.

EncryptConfigurationSection ( string configPath, string sectionName ) : void

This method is used to encrypt the particular section in the application config

FindConfigFileLocation ( string pathToConfigFile ) : string
GetConfiguration ( string configPath ) : Configuration
GetConfigurationSection ( string sectionName, Configuration config ) : ConfigurationSection
SetIndexesForConfigGroupCollectionRecursively ( ConfigurationGroupCollection configGroupCollection ) : void
SetIndexesForConfigGroupElementRecursively ( ConfigurationGroupElement configGroup ) : void

Method Details

Config() public méthode

Default constructor will give a blank configuration path and section, it will try and determine a the config path and choose the first valid section it can find.
public Config ( ) : System
Résultat System

Config() public méthode

public Config ( bool allowValueInheritance ) : System
allowValueInheritance bool
Résultat System

Config() public méthode

Constructor with the full configuration path given.
error if section is null or empty string error if fails to load given configuration section
public Config ( string configurationPath, bool allowValueInheritance = true ) : System
configurationPath string The xml path in the config file.
allowValueInheritance bool
Résultat System

Config() public méthode

Constructor with the full configuration path given.
error if section is null or empty string error if fails to load given configuration section
public Config ( string pathToConfigFile, string configurationPath ) : System
pathToConfigFile string
configurationPath string The xml path in the config file.
Résultat System

Config() public méthode

public Config ( string pathToConfigFile, string configurationPath, bool allowValueInheritance ) : System
pathToConfigFile string
configurationPath string
allowValueInheritance bool
Résultat System

ContainsKey() public méthode

Determines if the loader has a config section by the given name.
public ContainsKey ( string sectionName ) : bool
sectionName string
Résultat bool

CreateConfigKey() public méthode

public CreateConfigKey ( ) : void
Résultat void

DecryptConfigurationSection() public méthode

public DecryptConfigurationSection ( ) : void
Résultat void

DecryptConfigurationSection() public méthode

public DecryptConfigurationSection ( string sectionName ) : void
sectionName string
Résultat void

DecryptConfigurationSection() public méthode

This method is used to decrypt the particular section of the application config
public DecryptConfigurationSection ( string configPath, string sectionName ) : void
configPath string file path the configuration file.
sectionName string Section to encrypt
Résultat void

Dispose() public méthode

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Résultat void

EncryptConfigurationSection() public méthode

public EncryptConfigurationSection ( ) : void
Résultat void

EncryptConfigurationSection() public méthode

public EncryptConfigurationSection ( string sectionName ) : void
sectionName string
Résultat void

GetSection() public méthode

Get the config section by the name attribute.
public GetSection ( string sectionName ) : ConfigSection
sectionName string
Résultat ConfigSection