/// <summary> /// Gets the new instances of the implementations of the type specified by the type parameter /// or empty enumeration if no implementations found. /// </summary> /// <typeparam name="T">The type parameter to find implementations of.</typeparam> /// <param name="useCaching"> /// Determines whether the type cache should be used to avoid assemblies scanning next time, /// when the instance(s) of the same type(s) is requested. /// </param> /// <returns>The instances of the found implementations of the given type.</returns> public static IEnumerable <T> GetInstances <T>(bool useCaching = false) { return(ExtensionManager.GetInstances <T>(null, useCaching, new object[] { })); }
/// <summary> /// Gets the new instances (using constructor that matches the arguments) of the implementations /// of the type specified by the type parameter or empty enumeration if no implementations found. /// </summary> /// <typeparam name="T">The type parameter to find implementations of.</typeparam> /// <param name="useCaching"> /// Determines whether the type cache should be used to avoid assemblies scanning next time, /// when the instance(s) of the same type(s) is requested. /// </param> /// <param name="args">The arguments to be passed to the constructors.</param> /// <returns>The instances of the found implementations of the given type.</returns> public static IEnumerable <T> GetInstances <T>(bool useCaching = false, params object[] args) { return(ExtensionManager.GetInstances <T>(null, useCaching, args)); }
public static T GetInstance <T>() { return(ExtensionManager.GetInstance <T>(null)); }
/// <summary> /// Gets the new instance (using constructor that matches the arguments) of the first implementation /// of the type specified by the type parameter and located in the assemblies filtered by the predicate /// or null if no implementations found. /// </summary> /// <typeparam name="T">The type parameter to find implementation of.</typeparam> /// <param name="predicate">The predicate to filter the assemblies.</param> /// <param name="useCaching"> /// Determines whether the type cache should be used to avoid assemblies scanning next time, /// when the instance(s) of the same type(s) is requested. /// </param> /// <param name="args">The arguments to be passed to the constructor.</param> /// <returns>The instance of the first found implementation of the given type.</returns> public static T GetInstance <T>(Func <Assembly, bool> predicate, bool useCaching = false, params object[] args) { return(ExtensionManager.GetInstances <T>(predicate, useCaching, args).FirstOrDefault()); }
public static Type GetImplementation <T>() { return(ExtensionManager.GetImplementation <T>(null)); }
public static IEnumerable <Type> GetImplementations <T>() { return(ExtensionManager.GetImplementations <T>(null)); }
/// <summary> /// Gets the first implementation of the type specified by the type parameter and located in the assemblies /// filtered by the predicate or null if no implementations found. /// </summary> /// <typeparam name="T">The type parameter to find implementation of.</typeparam> /// <param name="predicate">The predicate to filter the assemblies.</param> /// <returns></returns> public static Type GetImplementation <T>(Func <Assembly, bool> predicate) { return(ExtensionManager.GetImplementations <T>(predicate).FirstOrDefault()); }
public static IEnumerable <T> GetInstances <T>() { return(ExtensionManager.GetInstances <T>(null)); }
/// <summary> /// Gets the new instances of the implementations of the type specified by the type parameter /// and located in the assemblies filtered by the predicate or empty enumeration /// if no implementations found. /// </summary> /// <typeparam name="T">The type parameter to find implementations of.</typeparam> /// <param name="predicate">The predicate to filter the assemblies.</param> /// <returns></returns> public static IEnumerable <T> GetInstances <T>(Func <Assembly, bool> predicate) { return(ExtensionManager.GetInstances <T>(predicate, new object[] { })); }
/// <summary> /// Gets the new instances (using constructor that matches the arguments) of the implementations /// of the type specified by the type parameter or empty enumeration if no implementations found. /// </summary> /// <typeparam name="T">The type parameter to find implementations of.</typeparam> /// <param name="args">The arguments to be passed to the constructors.</param> /// <returns></returns> public static IEnumerable <T> GetInstances <T>(params object[] args) { return(ExtensionManager.GetInstances <T>(null, args)); }
/// <summary> /// Gets the new instance of the first implementation of the type specified by the type parameter /// and located in the assemblies filtered by the predicate or null if no implementations found. /// </summary> /// <typeparam name="T">The type parameter to find implementation of.</typeparam> /// <param name="predicate">The predicate to filter the assemblies.</param> /// <returns></returns> public static T GetInstance <T>(Func <Assembly, bool> predicate) { return(ExtensionManager.GetInstances <T>(predicate).FirstOrDefault()); }
/// <summary> /// Gets the new instance (using constructor that matches the arguments) of the first implementation /// of the type specified by the type parameter or null if no implementations found. /// </summary> /// <typeparam name="T">The type parameter to find implementation of.</typeparam> /// <param name="args">The arguments to be passed to the constructor.</param> /// <returns></returns> public static T GetInstance <T>(params object[] args) { return(ExtensionManager.GetInstance <T>(null, args)); }
/// <summary> /// Gets the new instance of the first implementation of the type specified by the type parameter /// or null if no implementations found. /// </summary> /// <typeparam name="T">The type parameter to find implementation of.</typeparam> /// <returns></returns> public static T GetInstance <T>() { return(ExtensionManager.GetInstance <T>(null, new object[] { })); }