C# 클래스 Habanero.DB.DatabaseSettings

Stores database settings as a cache and updates or retrieves settings either from the cache or from the database if the cache value has expired
상속: System.MarshalByRefObject, ISettings
파일 보기 프로젝트 열기: Chillisoft/habanero 1 사용 예제들

공개 메소드들

메소드 설명
DatabaseSettings ( IDatabaseConnection databaseConnection ) : System

Constructor to initialise an empty store of settings, using the table name of "settings"

DatabaseSettings ( string tableName, IDatabaseConnection databaseConnection ) : System

Constructor to initialise an empty store of settings, specifying the table name to use to store the settings

GetBoolean ( string settingName ) : bool

Returns a specified setting as a boolean

GetDecimal ( string settingName ) : decimal

Returns the configuration for the setting name provided

GetDecimal ( string settingName, System.DateTime date ) : decimal

Returns a specified setting as a decimal

GetString ( string settingName ) : string

Returns a specified setting as a string

GetString ( string settingName, System.DateTime date ) : string

Returns a specified setting as a string

HasSetting ( string settingName ) : bool

Returns whether the setting exists or not.

SetBoolean ( string settingName, bool boolValue ) : void

Sets a specified setting as a boolean

SetDecimal ( string settingName, decimal settingValue ) : void

Sets a setting with a decimal value (using the InvariantCulture). Uses DateTime.Now for the date of the setting to indicate when the setting was changed.

SetString ( string settingName, string settingValue ) : void

Sets a specified setting as a string

비공개 메소드들

메소드 설명
CreateInsertStatement ( string settingName, string settingValue ) : SqlStatement

Creates a sql insert statement from the name and value provided

CreateSelectStatement ( string settingName, System.DateTime date ) : SqlStatement

Creates a sql select statement to retrieve the named setting at the date specified

CreateUpdateStatementNoDate ( string settingName, string settingValue ) : SqlStatement

Creates a sql update statement from the name and value provided, with no date specified

GetValue ( string settingName, System.DateTime date ) : object

Retrieves the named setting with the date specified, either from the cache or from the database if the cached value has expired

RetrieveSettingValue ( string settingName, System.DateTime date, object &value ) : bool
SetValue ( string settingName, string settingValue ) : void

Updates the named setting in the database with the value specified

UpdateCache ( string settingName ) : void

Refreshes the cached setting stored in this instance, by retrieving the updated setting from the database

메소드 상세

DatabaseSettings() 공개 메소드

Constructor to initialise an empty store of settings, using the table name of "settings"
public DatabaseSettings ( IDatabaseConnection databaseConnection ) : System
databaseConnection IDatabaseConnection
리턴 System

DatabaseSettings() 공개 메소드

Constructor to initialise an empty store of settings, specifying the table name to use to store the settings
public DatabaseSettings ( string tableName, IDatabaseConnection databaseConnection ) : System
tableName string The table name in which to store settings
databaseConnection IDatabaseConnection
리턴 System

GetBoolean() 공개 메소드

Returns a specified setting as a boolean
public GetBoolean ( string settingName ) : bool
settingName string The setting name
리턴 bool

GetDecimal() 공개 메소드

Returns the configuration for the setting name provided
public GetDecimal ( string settingName ) : decimal
settingName string The setting name
리턴 decimal

GetDecimal() 공개 메소드

Returns a specified setting as a decimal
public GetDecimal ( string settingName, System.DateTime date ) : decimal
settingName string The setting name
date System.DateTime The date at which to check the setting
리턴 decimal

GetString() 공개 메소드

Returns a specified setting as a string
public GetString ( string settingName ) : string
settingName string The setting name
리턴 string

GetString() 공개 메소드

Returns a specified setting as a string
public GetString ( string settingName, System.DateTime date ) : string
settingName string The setting name
date System.DateTime The date of the setting to retrieve /// (ie this method will retrieve the setting value as at this date
리턴 string

HasSetting() 공개 메소드

Returns whether the setting exists or not.
public HasSetting ( string settingName ) : bool
settingName string The name of the setting to look for.
리턴 bool

SetBoolean() 공개 메소드

Sets a specified setting as a boolean
public SetBoolean ( string settingName, bool boolValue ) : void
settingName string The setting name
boolValue bool The value to set it to
리턴 void

SetDecimal() 공개 메소드

Sets a setting with a decimal value (using the InvariantCulture). Uses DateTime.Now for the date of the setting to indicate when the setting was changed.
public SetDecimal ( string settingName, decimal settingValue ) : void
settingName string The name of the setting to set
settingValue decimal The value to set the setting to.
리턴 void

SetString() 공개 메소드

Sets a specified setting as a string
public SetString ( string settingName, string settingValue ) : void
settingName string The setting name
settingValue string The value to set it to
리턴 void