/// <exception cref="TypeLoadException">Condition.</exception> /// <exception cref="TargetInvocationException">A class initializer is invoked and throws an exception. </exception> /// <exception cref="BadImageFormatException">The assembly or one of its dependencies is not valid. -or-Version 2.0 or later of the common language runtime is currently loaded, and the assembly was compiled with a later version.</exception> public static Func <IConnectionPool, IIOService> GetFactory(IOServiceElement element) { return((p) => { var type = Type.GetType(element.Type); if (type == null) { throw new TypeLoadException(string.Format("Could not find: {0}", element.Type)); } return (IIOService)Activator.CreateInstance(type, p); }); }
/// <exception cref="TypeLoadException">Condition.</exception> /// <exception cref="TargetInvocationException">A class initializer is invoked and throws an exception. </exception> /// <exception cref="BadImageFormatException">The assembly or one of its dependencies is not valid. -or-Version 2.0 or later of the common language runtime is currently loaded, and the assembly was compiled with a later version.</exception> public static Func <IConnectionPool, IIOService> GetFactory(IOServiceElement element) { return(GetFactory(element.Type)); }