C# Class GSF.Configuration.ConfigurationFile

Represents a configuration file of a Windows or Web application.
显示文件 Open project: GridProtectionAlliance/gsf Class Usage Examples

Private Properties

Property Type Description
ConfigurationFile System
ConfigurationFile System
CreateConfigurationFile void
ExecuteConfigurationSave void
GetConfiguration System.Configuration.Configuration
TrimEnd string
ValidateConfigurationFile void

Public Methods

Method Description
Open ( string configFilePath ) : ConfigurationFile

Opens application config file at the specified configFilePath.

Reload ( ) : void

Reloads the current configuration settings from the configuration file that the ConfigurationFile represents.

RestoreDefaultUserSettings ( ) : void

Restores all the default settings for SettingScope.User scoped settings.

Save ( ) : void

Writes the configuration settings contained within this ConfigurationFile object to the configuration file that it represents.

Save ( ConfigurationSaveMode saveMode ) : void

Writes the configuration settings contained within this ConfigurationFile object to the configuration file that it represents.

SaveAs ( string fileName ) : void

Writes the configuration settings contained within this ConfigurationFile object to the specified configuration file.

SetCryptoKey ( string cryptoKey ) : void

Sets the key to be used for encrypting and decrypting values of Settings.

Private Methods

Method Description
ConfigurationFile ( ) : System
ConfigurationFile ( string configFilePath ) : System

Initializes a new instance of the ConfigurationFile class.

CreateConfigurationFile ( string configFilePath ) : void
ExecuteConfigurationSave ( ) : void
GetConfiguration ( string configFilePath ) : Configuration
TrimEnd ( string stringToTrim, string textToTrim ) : string
ValidateConfigurationFile ( string configFilePath ) : void

Method Details

Open() public static method

Opens application config file at the specified configFilePath.
public static Open ( string configFilePath ) : ConfigurationFile
configFilePath string Path of the config file that belongs to a Windows or Web application.
return ConfigurationFile

Reload() public method

Reloads the current configuration settings from the configuration file that the ConfigurationFile represents.
public Reload ( ) : void
return void

RestoreDefaultUserSettings() public method

Restores all the default settings for SettingScope.User scoped settings.
public RestoreDefaultUserSettings ( ) : void
return void

Save() public method

Writes the configuration settings contained within this ConfigurationFile object to the configuration file that it represents.
public Save ( ) : void
return void

Save() public method

Writes the configuration settings contained within this ConfigurationFile object to the configuration file that it represents.
public Save ( ConfigurationSaveMode saveMode ) : void
saveMode ConfigurationSaveMode One of the values.
return void

SaveAs() public method

Writes the configuration settings contained within this ConfigurationFile object to the specified configuration file.
public SaveAs ( string fileName ) : void
fileName string The path and file name to save the configuration file to.
return void

SetCryptoKey() public method

Sets the key to be used for encrypting and decrypting values of Settings.
public SetCryptoKey ( string cryptoKey ) : void
cryptoKey string New crypto key.
return void