C# Класс Habanero.DB.DatabaseConfig

Stores database configuration settings and creates connections using these settings
Наследование: IDatabaseConfig, ISupportsRSADecryption
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
DatabaseConfig ( IDictionary settings ) : System

A constructor as before, but with the configuration settings passed as an IDictionary object

DatabaseConfig ( string vendor, string server, string database, string userName, string password, string port ) : System

A constructor with specific configurations provided

Equals ( object obj ) : bool

Checks whether this database configuration is equal to that of the object provided

GetConnection ( ) : IDbConnection

Creates a database connection using the configuration settings stored

GetConnectionString ( ) : String

Returns a connection string tailored for the database vendor

GetDatabaseConnection ( ) : IDatabaseConnection

Creates a database connection using the configuration settings stored

GetHashCode ( ) : int

Returns the hashcode of all the settings added together

ISupportsRSADecryption ( string xmlPrivateKey ) : void

Sets the private key to use to decrypt the password. The private key is in xml format.

ReadFromConfigFile ( ) : DatabaseConfig

Creates a new configuration object by reading the "DatabaseConfig" settings from the project's configuration settings

ReadFromConfigFile ( string configSectionName ) : DatabaseConfig

Creates a new configuration object by reading the "DatabaseConfig" settings from the project's configuration settings

SetPrivateKey ( RSA privateKey ) : void

Sets the private key to use to decrypt password. The private key is an RSA object.

SetPrivateKey ( string xmlPrivateKey ) : void

Sets the private key to use to decrypt the password. The private key is in xml format.

ToString ( ) : string

Returns a string with all the settings listed

Защищенные методы

Метод Описание
Clone ( ) : DatabaseConfig

Приватные методы

Метод Описание
DatabaseConfig ( ) : System

A deparameterised constructor

Описание методов

Clone() защищенный Метод

protected Clone ( ) : DatabaseConfig
Результат DatabaseConfig

DatabaseConfig() публичный Метод

A constructor as before, but with the configuration settings passed as an IDictionary object
public DatabaseConfig ( IDictionary settings ) : System
settings IDictionary An IDictionary object containing entries /// for "vendor", "server", "database", "username", "password" and /// "port"
Результат System

DatabaseConfig() публичный Метод

A constructor with specific configurations provided
public DatabaseConfig ( string vendor, string server, string database, string userName, string password, string port ) : System
vendor string The database vendor - use the strings /// provided (eg. DatabaseConfig.MySql)
server string The database server
database string The database name
userName string The username
password string The password
port string The port
Результат System

Equals() публичный Метод

Checks whether this database configuration is equal to that of the object provided
public Equals ( object obj ) : bool
obj object The object to compare with, which must be a /// type of DatabaseConfig
Результат bool

GetConnection() публичный Метод

Creates a database connection using the configuration settings stored
public GetConnection ( ) : IDbConnection
Результат IDbConnection

GetConnectionString() публичный Метод

Returns a connection string tailored for the database vendor
public GetConnectionString ( ) : String
Результат String

GetDatabaseConnection() публичный Метод

Creates a database connection using the configuration settings stored
public GetDatabaseConnection ( ) : IDatabaseConnection
Результат IDatabaseConnection

GetHashCode() публичный Метод

Returns the hashcode of all the settings added together
public GetHashCode ( ) : int
Результат int

ISupportsRSADecryption() публичный Метод

Sets the private key to use to decrypt the password. The private key is in xml format.
public ISupportsRSADecryption ( string xmlPrivateKey ) : void
xmlPrivateKey string The xml format of the RSA key (RSA.ToXmlString(true))
Результат void

ReadFromConfigFile() публичный статический Метод

Creates a new configuration object by reading the "DatabaseConfig" settings from the project's configuration settings
public static ReadFromConfigFile ( ) : DatabaseConfig
Результат DatabaseConfig

ReadFromConfigFile() публичный статический Метод

Creates a new configuration object by reading the "DatabaseConfig" settings from the project's configuration settings
public static ReadFromConfigFile ( string configSectionName ) : DatabaseConfig
configSectionName string The name of the Config Setting Section where the database connection settings are stored.
Результат DatabaseConfig

SetPrivateKey() публичный Метод

Sets the private key to use to decrypt password. The private key is an RSA object.
public SetPrivateKey ( RSA privateKey ) : void
privateKey System.Security.Cryptography.RSA The RSA object which has the private key
Результат void

SetPrivateKey() публичный Метод

Sets the private key to use to decrypt the password. The private key is in xml format.
public SetPrivateKey ( string xmlPrivateKey ) : void
xmlPrivateKey string The xml format of the RSA key (RSA.ToXmlString(true))
Результат void

ToString() публичный Метод

Returns a string with all the settings listed
public ToString ( ) : string
Результат string