Added generic collections of objects. TODO: deserialization of metadata

This commit is contained in:
schnulller
2022-06-19 23:20:35 +02:00
parent d8a4fe7790
commit ba3d63ffba
17 changed files with 175 additions and 75 deletions

View File

@@ -0,0 +1,20 @@
namespace HaWeb.Models;
using HaWeb.SearchHelpers;
using HaWeb.XMLParser;
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 XElement ELement { get; private set; }
public IXMLRoot Root { get; private set; }
public CollectedItem(string index, XElement element, IXMLRoot root, string collection, string? searchtext = null) {
this.Index = index;
this.SearchText = searchtext;
this.Collection = collection;
this.Root = root;
this.ELement = element;
}
}

View File

@@ -32,9 +32,10 @@ public class FileList {
public FileList Clone() {
var ret = new FileList(this.XMLRoot);
foreach (var file in _Files) {
ret.Add(file);
}
if (_Files != null)
foreach (var file in _Files) {
ret.Add(file);
}
return ret;
}
}