/// <summary> /// Creates an instance of the <see cref="IDataProvider"/> class by using /// the specified <paramref name="provider"/> object and a list of /// constructor arguments. /// </summary> /// <param name="provider">A <see cref="ProviderNode"/> /// object that contains information about the class that should be /// instantiated.</param> /// <param name="args">An array of arguments that match in number, order, /// and type the parameters of the constructor to invoke. If args is an /// empty array or null, the constructor that takes no parameters(the /// default constructor) is invoked.</param> /// <remarks> /// <para>The <see cref="ProviderNode.AssemblyLocation"/> will be used as /// a search location for assemblies that need to be loaded in order to /// create the desired provider instance. /// </para> /// </remarks> /// <returns>An object that implements the <see cref="IDataProvider"/> /// interface and has the same type that is defined by the /// <paramref name="provider"/> object.</returns> /// <exception cref="ArgumentNullException">provider is null. /// </exception> /// <exception cref="ProviderException">The type could not be created. /// </exception> protected static IDataProvider CreateDataProvider( DataProviderNode provider, params object[] args) { return(ProviderHelper.CreateFromProviderNode <IDataProvider>( provider, args)); }