mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 17:25:32 +00:00
Created FileList with ability to set used files
This commit is contained in:
@@ -14,4 +14,6 @@ public interface IXMLService {
|
||||
public void AutoUse(string prefix);
|
||||
public void AutoUse(FileList filelist);
|
||||
public Dictionary<string, FileList?>? GetInProduction();
|
||||
public void UnUse(string prefix);
|
||||
public void UnUseProduction();
|
||||
}
|
||||
@@ -34,6 +34,8 @@ public class XMLService : IXMLService {
|
||||
|
||||
public Dictionary<string, FileList?>? GetInProduction() => this._InProduction;
|
||||
|
||||
public void UnUseProduction() => this._InProduction = null;
|
||||
|
||||
public List<XMLRootDocument>? ProbeHamannFile(XDocument document, ModelStateDictionary ModelState) {
|
||||
if (document.Root!.Name != "opus") {
|
||||
ModelState.AddModelError("Error", "A valid Hamann-Docuemnt must begin with <opus>");
|
||||
@@ -66,6 +68,11 @@ public class XMLService : IXMLService {
|
||||
_Used[doc.Prefix]!.Add(doc);
|
||||
}
|
||||
|
||||
public void UnUse(string prefix) {
|
||||
if (_Used != null && _Used.ContainsKey(prefix)) _Used.Remove(prefix);
|
||||
return;
|
||||
}
|
||||
|
||||
// Performs detection of using on the specified document type
|
||||
public void AutoUse(string prefix) {
|
||||
if (_Used == null || !_Used.ContainsKey(prefix)) return;
|
||||
|
||||
Reference in New Issue
Block a user