namespace HaWeb.Settings.XMLCollections; using HaWeb.Models; using System.Xml.Linq; public class EditreasonCollection : HaWeb.XMLParser.IXMLCollection { public string Key { get; } = "editreasons"; public string[] xPath { get; } = new string[] { "/opus/edits/editreason", "/opus/data/edits/editreason" }; public Func GenerateKey { get; } = GetKey; public Func?>? GenerateDataFields { get; } = null; public Func, IDictionary>?>? GroupingsGeneration { get; } = null; public Func, IDictionary>?>? SortingsGeneration { get; } = null; public HaWeb.XMLParser.IXMLCollection[]? SubCollections { get; } = null; public bool Searchable { get; } = true; public static Func GetKey { get; } = (elem) => { var index = elem.Attribute("index"); if (index != null && !String.IsNullOrWhiteSpace(index.Value)) return index.Value; else return null; }; }