C# Class NuGet.SettingsExtensions

Exibir arquivo Open project: themotleyfool/NuGet

Public Methods

Method Description
DeleteConfigValue ( this settings, string key ) : bool

Deletes a config value from settings

GetConfigValue ( this settings, string key, bool decrypt = false ) : string

Retrieves a config value for the specified key

GetDecryptedValue ( this settings, string section, string key ) : string
SetConfigValue ( this settings, string key, string value, bool encrypt = false ) : void

Sets a config value in the setting.

SetEncryptedValue ( this settings, string section, string key, string value ) : void

Method Details

DeleteConfigValue() public static method

Deletes a config value from settings
public static DeleteConfigValue ( this settings, string key ) : bool
settings this The settings instance to delete the key from.
key string The key to delete.
return bool

GetConfigValue() public static method

Retrieves a config value for the specified key
public static GetConfigValue ( this settings, string key, bool decrypt = false ) : string
settings this The settings instance to retrieve
key string The key to look up
decrypt bool Determines if the retrieved value needs to be decrypted.
return string

GetDecryptedValue() public static method

public static GetDecryptedValue ( this settings, string section, string key ) : string
settings this
section string
key string
return string

SetConfigValue() public static method

Sets a config value in the setting.
public static SetConfigValue ( this settings, string key, string value, bool encrypt = false ) : void
settings this The settings instance to store the key-value in.
key string The key to store.
value string The value to store.
encrypt bool Determines if the value needs to be encrypted prior to storing.
return void

SetEncryptedValue() public static method

public static SetEncryptedValue ( this settings, string section, string key, string value ) : void
settings this
section string
key string
value string
return void