//
        // methods
        //

        /// <summary>
        /// Adds a custom provider to the configured set of providers
        /// </summary>
        /// <param name="providerName"></param>
        /// <param name="implemementation"></param>
        internal void Add(string providerName, DBProviderImplementation implemementation)
        {
            DBProviderImplementationConfigElement ele = new DBProviderImplementationConfigElement(
                providerName,
                implemementation.GetType().AssemblyQualifiedName,
                implemementation);

            this.Implementations.Add(ele);
        }
Example #2
0
        //
        // collection modification methods
        //

        /// <summary>
        /// Adds a new implementation by taking the values from the instance itself and adding to the collection.
        /// It is an error if there is already an implementation with the same name (case in-sensitive)
        /// </summary>
        /// <param name="imp">The implementation to add</param>
        public void Add(DBProviderImplementation imp)
        {
            string name     = imp.ProviderName;
            string typename = imp.GetType().AssemblyQualifiedName;
            DBProviderImplementationConfigElement ele = new DBProviderImplementationConfigElement(
                name, typename, imp);

            this.Add(ele);
        }
        /// <summary>
        /// Gets the implementation from the configured collection with the specified name
        /// </summary>
        /// <param name="providername"></param>
        /// <returns></returns>
        internal DBProviderImplementation Get(string providername)
        {
            DBProviderImplementationConfigElement ele = this.Implementations.Get(providername);

            if (null == ele)
            {
                throw new NullReferenceException(String.Format(Errors.NoProviderImplementationWithTheName, providername));
            }

            return(ele.Implementation);
        }
Example #4
0
 /// <summary>
 /// Adds a configured element to the collection
 /// </summary>
 /// <param name="element"></param>
 internal void Add(DBProviderImplementationConfigElement element)
 {
     this.BaseAdd(element);
 }