Переосмысление аттрибутов переберающих процессоров и устаревшых элементов
This commit is contained in:
@@ -24,7 +24,7 @@ internal class ProcessorCollection
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public ProcessorCollectionItem this[string name] => Items.First(item => item.Name == name);
|
||||
public ProcessorCollectionItem this[string name] => AllItems.First(item => item.Name == name);
|
||||
|
||||
/// <summary>
|
||||
/// Конструктор класса <see cref="ProcessorCollection"/>.
|
||||
@@ -65,7 +65,19 @@ internal class ProcessorCollection
|
||||
ProcessorDependenciesAttribute? dependenciesAttribute =
|
||||
type.GetCustomAttribute<ProcessorDependenciesAttribute>();
|
||||
|
||||
bool isCollection = processorAttribute.InnerType is not null;
|
||||
bool isCollection = processorAttribute.Collection;
|
||||
|
||||
string? innerType = null;
|
||||
ProcessorCompendiumEnum? compendium = null;
|
||||
|
||||
if (processorAttribute.GetType() == typeof(ProcessorCollectionAttribute))
|
||||
{
|
||||
ProcessorCollectionAttribute processorCollectionAttribute =
|
||||
(ProcessorCollectionAttribute)processorAttribute;
|
||||
|
||||
innerType = processorCollectionAttribute.InnerType;
|
||||
compendium = processorCollectionAttribute.CompendiumType;
|
||||
}
|
||||
|
||||
return new()
|
||||
{
|
||||
@@ -74,8 +86,9 @@ internal class ProcessorCollection
|
||||
Description = processorAttribute.Description,
|
||||
Group = processorAttribute.Group,
|
||||
Dependencies = dependenciesAttribute?.Dependencies ?? [],
|
||||
IsCollectionProcessor = isCollection,
|
||||
InnerType = processorAttribute.InnerType,
|
||||
IsCollection = isCollection,
|
||||
InnerType = innerType,
|
||||
Compendium = compendium,
|
||||
Active = processorAttribute.Active,
|
||||
};
|
||||
}
|
||||
@@ -216,10 +229,16 @@ internal class ProcessorCollectionItem
|
||||
/// Флаг, указывающий, обрабатывает ли обработчик коллекцию элементов.
|
||||
/// Внутренний тип элементов указывается в <see cref="InnerType"/>.
|
||||
/// </summary>
|
||||
public required bool IsCollectionProcessor { get; init; }
|
||||
public required bool IsCollection { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Флаг, указывающий внутренний тип коллекции обрабатываемых элементов.
|
||||
/// </summary>
|
||||
public string? InnerType { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Название типов, который обрабатывает этот оброботчик.
|
||||
/// <c>null</c> - обработать все типы.
|
||||
/// </summary>
|
||||
public ProcessorCompendiumEnum? Compendium { get; init; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user