|
using System;
using System.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder;
using Project.Practice.DB;
namespace Project.Practice.DB.Configuration
{
[Assembler(typeof(DBAssembler))]
public class DBData : NameTypeConfigurationElement
{
private const string userIdProperty = "userID";
private const string passwordProperty = "password";
private const string serverProperty = "server";
private const string databaseProperty = "database";
public DBData()
: base("DBData", typeof(IDBProvider))
{
}
public DBData(string name, Type type)
: base(name, type)
{
}
[ConfigurationProperty(userIdProperty, IsRequired = true)]
public string UserId
{
get { return (string)this[userIdProperty]; }
set { this[userIdProperty] = value; }
}
[ConfigurationProperty(passwordProperty, IsRequired = true)]
public string Password
{
get { return (string)this[passwordProperty]; }
set { this[passwordProperty] = value; }
}
[ConfigurationProperty(serverProperty, IsRequired = true)]
public string Server
{
get { return (string)this[serverProperty]; }
set { this[serverProperty] = value; }
}
[ConfigurationProperty(databaseProperty, IsRequired = false)]
public string Database
{
get { return (string)this[databaseProperty]; }
set { this[databaseProperty] = value; }
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.