예제 #1
0
        private void cbConfigs_SelectedIndexChanged(object sender, EventArgs e)
        {
            XmlNode xnConfig = xnConnectionStrings.SelectSingleNode("add[@name=\"" + cbConfigs.SelectedItem + "\"]");
            HKHConnectionStringElement hse = new HKHConnectionStringElement(xnConfig.Attributes["name"].Value, xnConfig.Attributes["connectionString"].Value);

            //set encryption
            if (xnConfig.Attributes["encrypt"] != null && xnConfig.Attributes["encrypt"].Value.ToLower() == "true")
            {
                hse.Encrypt = true;
            }
            if (xnConfig.Attributes["algo"] != null)
            {
                hse.Algo = xnConfig.Attributes["algo"].Value;
            }

            encryption = hse.GetEncryptionAlgo();
        }
예제 #2
0
        /// <summary>
        /// Get special Instance of IDataProvider
        /// </summary>
        /// <param name="dbConfiguration"></param>
        /// <returns></returns>
        public static IDataProvider GetInstance(HKHConnectionStringElement dbConfiguration)
        {
            IDataProvider dataProvider = null;

            if (!dataProviders.TryGetValue(dbConfiguration.Name, out dataProvider))
            {
                lock (typeof(DataBaseObjectBuilderFactory))
                {
                    if (!dataProviders.TryGetValue(dbConfiguration.Name, out dataProvider))
                    {
                        dataProvider = new DataProvider(DataBaseObjectBuilderFactory.GetDataBaseObjectBuilder(dbConfiguration));
                        dataProviders.TryAdd(dbConfiguration.Name, dataProvider);
                    }
                }
            }

            return(dataProvider);
        }
예제 #3
0
 public SqlDatabaseObjectBuilder(HKHConnectionStringElement configuration)
     : base(configuration)
 {
     InitRetryPolicy();
 }
예제 #4
0
 protected DataBaseObjectBuilder(string connectionString)
     : base(connectionString)
 {
     this.configuration = HKHConnectionStringElement.Null;
 }
예제 #5
0
 protected DataBaseObjectBuilder(HKHConnectionStringElement configuration)
     : base(configuration.ConnectionString)
 {
     this.configuration = configuration;
 }
예제 #6
0
 public SqlServerObjectBuilder(HKHConnectionStringElement configuration)
     : base(configuration)
 {
 }
예제 #7
0
 public OleDbObjectBuilder(HKHConnectionStringElement configuration)
     : base(configuration)
 {
 }
예제 #8
0
 public TransactionController(HKHConnectionStringElement dbConfiguration)
     : this(DataBaseObjectBuilderFactory.GetDataBaseObjectBuilder(dbConfiguration))
 {
 }
 /// <summary>
 /// Get special Instance of IDataBaseObjectBuilder
 /// </summary>
 /// <param name="dbConfigName"></param>
 /// <param name="Conn"></param>
 /// <param name="Trans"></param>
 /// <returns></returns>
 internal static IDataBaseObjectBuilder GetDataBaseObjectBuilder(HKHConnectionStringElement dbConfiguration)
 {
     return(GetDataBaseObjectBuilder(Type.GetType(dbConfiguration.Builder), dbConfiguration.ConnectionString));
 }