mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-30 01:35:32 +00:00
Added collection classes. Will not do extra collection for subcomments rn.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using System.Reflection.Emit;
|
||||
using System.Collections;
|
||||
namespace HaWeb.Models;
|
||||
using HaWeb.SearchHelpers;
|
||||
using HaWeb.XMLParser;
|
||||
@@ -5,25 +7,30 @@ using System.Xml.Linq;
|
||||
|
||||
public class CollectedItem : ISearchable {
|
||||
public string Index { get; private set; }
|
||||
public string Collection { get; private set; }
|
||||
public string? SearchText { get; private set; }
|
||||
public Dictionary<string, string[]>? Fields { get; private set; }
|
||||
public IDictionary<string, string>? Fields { get; private set; }
|
||||
public XElement ELement { get; private set; }
|
||||
public IXMLRoot Root { get; private set; }
|
||||
public IXMLCollection Collection { get; private set; }
|
||||
|
||||
public CollectedItem(
|
||||
string index,
|
||||
XElement element,
|
||||
IXMLRoot root,
|
||||
string collection,
|
||||
Dictionary<string, string[]>? fields,
|
||||
IXMLCollection collection,
|
||||
IDictionary<string, string>? fields,
|
||||
string? searchtext = null
|
||||
) {
|
||||
this.Index = index;
|
||||
this.SearchText = searchtext;
|
||||
this.Collection = collection;
|
||||
this.Root = root;
|
||||
this.ELement = element;
|
||||
this.Fields = fields;
|
||||
}
|
||||
|
||||
public string? this[string v] {
|
||||
get {
|
||||
if (Fields != null && Fields.ContainsKey(v))
|
||||
return Fields[v];
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user