/// <summary> /// Searches for the command and alias attributes in all types. /// </summary> /// <param name="commandService">command service instance</param> /// <param name="types">list of types to search</param> public static void AddCommands(this ICommandService commandService, IEnumerable <Type> types) { foreach (Type type in types) { commandService.AddCommands(type); } }
/// <summary> /// Add the commands and aliases attributes found in the type. /// </summary> /// <param name="commandService">command service instance</param> /// <param name="type">Command type to search</param> public static void AddCommands(this ICommandService commandService, Type type) { commandService.AddCommands(type, factory: null); }
/// <summary> /// Add commands from an assembly. Searches for the command and alias attributes in all the assembly's types. /// </summary> /// <param name="commandService">command service instance</param> /// <param name="assembly">assembly to search for commands</param> public static void AddCommands(this ICommandService commandService, Assembly assembly) { commandService.AddCommands(assembly.GetExportedTypes()); }
/// <summary> /// Add commands from assemblies. Searches for the command and alias attributes in all the assemblies' types. /// </summary> /// <param name="commandService">command service instance</param> /// <param name="assemblies">list of assemblies to search</param> public static void AddCommands(this ICommandService commandService, IEnumerable <Assembly> assemblies) { commandService.AddCommands(assemblies.SelectMany((assembly) => assembly.GetExportedTypes())); }