/// <summary> /// Finds all dependency runtime types (instantiable types) which matches the criteria /// </summary> /// <param name="runtimeTypes">Types</param> /// <param name="typeParser">Parset</param> /// <param name="typeId">Id</param> /// <param name="args">Values</param> /// <returns></returns> public static IRuntimeType[] GetRuntimeTypes(this IEnumerable <IRuntimeType> runtimeTypes, ITypeParser typeParser, string typeId, string[] args) => typeParser.FindRuntimeTypes(typeId, Format.GetNames(args), runtimeTypes.Where((p) => p.Attribute is IDependencyAttribute)).ToArray();
/// <summary> /// Finds the specified identifier. /// </summary> /// <param name="typeId">The identifier.</param> /// <param name="args">The arguments.</param> /// <param name="types">The types.</param> /// <returns></returns> public static IRuntimeType Find(this ITypeParser typeParser, string typeId, IEnumerable <string> args, IEnumerable <IRuntimeType> types) => typeParser.FindRuntimeTypes(typeId, args, types).FirstOrDefault();
/// <summary> /// Finds all dependency runtime types (instantiable types) which matches the criteria /// </summary> /// <param name="runtimeTypes">Types</param> /// <param name="typeParser">Parset</param> /// <param name="runtimeType">Id</param> /// <param name="args">Values</param> /// <returns></returns> public static IRuntimeType[] FindRuntimeTypes(this IEnumerable <IRuntimeType> runtimeTypes, ITypeParser typeParser, IRuntimeType runtimeType, object[] args) => typeParser.FindRuntimeTypes(runtimeType.TypeFullName, Format.GetNames(args), runtimeTypes.Where((p) => p.Attribute is IDependencyAttribute)).Where((p) => p.ActivatorType == runtimeType.ActivatorType).ToArray();