/// <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="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>(bool useCaching = false, params object[] args) { return(ExtensionManager.GetInstance <T>(null, useCaching, 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> /// <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 instance of the first found implementation of the given type.</returns> public static T GetInstance <T>(bool useCaching = false) { return(ExtensionManager.GetInstance <T>(null, useCaching, new object[] { })); }
/// <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)); }
public static T GetInstance <T>() { return(ExtensionManager.GetInstance <T>(null)); }
/// <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[] { })); }