Exemplo n.º 1
0
        //
        // 集合实现
        //

        /// <summary>
        /// add方法
        /// </summary>
        /// <param name="imp"> 提供者实例</param>
        public void Add(DBProvider provider)
        {
            string name                 = provider.ProviderName;
            string typename             = provider.GetType().AssemblyQualifiedName;
            DBProviderConfigElement ele = new DBProviderConfigElement(
                name, typename, provider);

            this.Add(ele);
        }
Exemplo n.º 2
0
        //
        // 方法
        //

        /// <summary>
        /// 增加方法
        /// </summary>
        /// <param name="providerName"></param>
        /// <param name="implemementation"></param>
        internal void Add(string providerName, DBProvider provider)
        {
            DBProviderConfigElement ele = new DBProviderConfigElement(
                providerName,
                provider.GetType().AssemblyQualifiedName,
                provider);

            this.Providers.Add(ele);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取值
        /// </summary>
        /// <param name="providername"></param>
        /// <returns></returns>
        internal DBProvider Get(string providername)
        {
            DBProviderConfigElement ele = this.Providers.Get(providername);

            if (null == ele)
            {
                throw new Exception(string.Format(DbError.ProviderNameError, providername));
            }

            return(ele.Provider);
        }
Exemplo n.º 4
0
 /// <summary>
 /// add 方法
 /// </summary>
 /// <param name="element"></param>
 internal void Add(DBProviderConfigElement element)
 {
     this.BaseAdd(element);
 }