|
@@ -64,7 +64,7 @@ namespace Quadarax.Foundation.QConsole
|
|
|
{
|
|
{
|
|
|
var command = Construct<AbstractCommand>(commandClass, paramConstrTypes, paramConstrValues);
|
|
var command = Construct<AbstractCommand>(commandClass, paramConstrTypes, paramConstrValues);
|
|
|
_commands.Add(command);
|
|
_commands.Add(command);
|
|
|
- WriteDebugInfo($"Command definition '{command}' added.");
|
|
|
|
|
|
|
+ WriteDebugInfo($"Command definition '{command}' added - class '{command.GetType().FullName}', assembly '{command.GetType().Assembly.GetName().Name}'.");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
WriteDebugInfo("Console initialized.");
|
|
WriteDebugInfo("Console initialized.");
|
|
@@ -223,14 +223,14 @@ namespace Quadarax.Foundation.QConsole
|
|
|
|
|
|
|
|
WriteDebugInfo($"Loading command assemblies ...");
|
|
WriteDebugInfo($"Loading command assemblies ...");
|
|
|
|
|
|
|
|
- var defaultTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => type.GetCustomAttributes(attribute.GetType(), true).Length > 0).ToList();
|
|
|
|
|
|
|
+ var defaultTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => type.GetCustomAttributes(attribute.GetType(), true).Length > 0).Distinct().ToList();
|
|
|
|
|
|
|
|
var customTypes = new List<Type>();
|
|
var customTypes = new List<Type>();
|
|
|
if (_configuration.CommandDefinitionAssebmly != null)
|
|
if (_configuration.CommandDefinitionAssebmly != null)
|
|
|
{
|
|
{
|
|
|
foreach (var assembly in _configuration.CommandDefinitionAssebmly)
|
|
foreach (var assembly in _configuration.CommandDefinitionAssebmly)
|
|
|
{
|
|
{
|
|
|
- customTypes.AddRange(assembly.GetTypes().Where(type => type.GetCustomAttributes(attribute.GetType(), true).Length > 0).ToArray());
|
|
|
|
|
|
|
+ customTypes.AddRange(assembly.GetTypes().Where(type => type.GetCustomAttributes(attribute.GetType(), true).Length > 0).Distinct().ToArray());
|
|
|
WriteDebugInfo(assembly.GetName().Name + " was scanned for commands.");
|
|
WriteDebugInfo(assembly.GetName().Name + " was scanned for commands.");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -240,6 +240,7 @@ namespace Quadarax.Foundation.QConsole
|
|
|
}
|
|
}
|
|
|
WriteDebugInfo($"Command definition obtaining process found {defaultTypes.Count} default definitions and {customTypes.Count} custom definitions.");
|
|
WriteDebugInfo($"Command definition obtaining process found {defaultTypes.Count} default definitions and {customTypes.Count} custom definitions.");
|
|
|
defaultTypes.AddRange(customTypes);
|
|
defaultTypes.AddRange(customTypes);
|
|
|
|
|
+ defaultTypes = defaultTypes.Distinct().ToList();
|
|
|
|
|
|
|
|
foreach (var disabledCommand in _configuration.DisabledCommands)
|
|
foreach (var disabledCommand in _configuration.DisabledCommands)
|
|
|
{
|
|
{
|
|
@@ -247,7 +248,7 @@ namespace Quadarax.Foundation.QConsole
|
|
|
if (disabled==null)
|
|
if (disabled==null)
|
|
|
continue;
|
|
continue;
|
|
|
defaultTypes.Remove(disabled);
|
|
defaultTypes.Remove(disabled);
|
|
|
- WriteDebugInfo($"Commnad class '{disabled.Name}' was skipped by configuration.");
|
|
|
|
|
|
|
+ WriteDebugInfo($"Commnad class '{disabled.Name}', fullname '{disabled.FullName}', assembly '{disabled.Assembly.GetName().Name}' was skipped by configuration.");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return defaultTypes.ToArray();
|
|
return defaultTypes.ToArray();
|