mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-30 01:35:32 +00:00
Further developed collections
This commit is contained in:
@@ -19,6 +19,10 @@ public interface IXMLCollection {
|
||||
abstract Func<XElement, IDictionary<string, string>?>? GenerateDataFields { get; }
|
||||
abstract Func<IEnumerable<CollectedItem>, IDictionary<string, ILookup<string, CollectedItem>>?>? GroupingsGeneration { get; }
|
||||
abstract Func<IEnumerable<CollectedItem>, IDictionary<string, IEnumerable<CollectedItem>>?>? SortingsGeneration { get; }
|
||||
// TODO Not implemented yet
|
||||
abstract IXMLCollection[]? SubCollections { get; }
|
||||
abstract bool Searchable { get; }
|
||||
|
||||
// Override with false if collection should not be read in and available globally (useful for SubCollections)
|
||||
bool IsGlobal() => true;
|
||||
}
|
||||
@@ -32,7 +32,7 @@ public class XMLService : IXMLService {
|
||||
collectiontypes.ForEach( x => {
|
||||
if (this._Collections == null) this._Collections = new Dictionary<string, IXMLCollection>();
|
||||
var instance = (IXMLCollection)Activator.CreateInstance(x)!;
|
||||
if (instance != null) this._Collections.Add(instance.Key, instance);
|
||||
if (instance != null && instance.IsGlobal()) this._Collections.Add(instance.Key, instance);
|
||||
});
|
||||
|
||||
if (_Roots == null || !_Roots.Any())
|
||||
|
||||
Reference in New Issue
Block a user