C# 클래스 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.
상속: IDisposable
파일 보기 프로젝트 열기: twistedtwig/CustomConfigurations 1 사용 예제들

공개 메소드들

메소드 설명
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.

비공개 메소드들

메소드 설명
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

메소드 상세

Config() 공개 메소드

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
리턴 System

Config() 공개 메소드

public Config ( bool allowValueInheritance ) : System
allowValueInheritance bool
리턴 System

Config() 공개 메소드

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
리턴 System

Config() 공개 메소드

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.
리턴 System

Config() 공개 메소드

public Config ( string pathToConfigFile, string configurationPath, bool allowValueInheritance ) : System
pathToConfigFile string
configurationPath string
allowValueInheritance bool
리턴 System

ContainsKey() 공개 메소드

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

CreateConfigKey() 공개 메소드

public CreateConfigKey ( ) : void
리턴 void

DecryptConfigurationSection() 공개 메소드

public DecryptConfigurationSection ( ) : void
리턴 void

DecryptConfigurationSection() 공개 메소드

public DecryptConfigurationSection ( string sectionName ) : void
sectionName string
리턴 void

DecryptConfigurationSection() 공개 메소드

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
리턴 void

Dispose() 공개 메소드

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

EncryptConfigurationSection() 공개 메소드

public EncryptConfigurationSection ( ) : void
리턴 void

EncryptConfigurationSection() 공개 메소드

public EncryptConfigurationSection ( string sectionName ) : void
sectionName string
리턴 void

GetSection() 공개 메소드

Get the config section by the name attribute.
public GetSection ( string sectionName ) : ConfigSection
sectionName string
리턴 ConfigSection