C# 클래스 Habanero.DB.DatabaseConfig

Stores database configuration settings and creates connections using these settings
상속: IDatabaseConfig, ISupportsRSADecryption
파일 보기 프로젝트 열기: Chillisoft/habanero 1 사용 예제들

공개 메소드들

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