mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-30 01:35:32 +00:00
Results of SyntaxCheck -> extra State
This commit is contained in:
@@ -27,13 +27,4 @@ public class FileList {
|
||||
|
||||
public List<XMLRootDocument>? GetFileList()
|
||||
=> this._Files != null ? this._Files.ToList() : null;
|
||||
|
||||
public FileList Clone() {
|
||||
var ret = new FileList(this.XMLRoot);
|
||||
if (_Files != null)
|
||||
foreach (var file in _Files) {
|
||||
ret.Add(file);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace HaWeb.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
public class YearSetting {
|
||||
[Required]
|
||||
public int EndYear { get; set; }
|
||||
}
|
||||
@@ -1,22 +1,22 @@
|
||||
namespace HaWeb.Models;
|
||||
|
||||
public class SyntaxCheckModel {
|
||||
public string Prefix { get; private set; }
|
||||
public List<SyntaxError>? Errors { get; set; }
|
||||
public List<SyntaxError>? Warnings { get; set; }
|
||||
public string File { get; private set; }
|
||||
public List<SyntaxError>? Errors { get; private set; }
|
||||
|
||||
public SyntaxCheckModel(string prefix) {
|
||||
Prefix = prefix;
|
||||
public SyntaxCheckModel(string file) {
|
||||
File = file;
|
||||
}
|
||||
|
||||
public void Log(int? line, int? column, string msg) {
|
||||
if (String.IsNullOrWhiteSpace(msg)) return;
|
||||
if (Errors == null) Errors = new();
|
||||
// var prefix = DateTime.Now.ToLongDateString() + ": ";
|
||||
Errors.Add(new SyntaxError(line, column, msg));
|
||||
}
|
||||
|
||||
public void ResetLog() {
|
||||
Errors = null;
|
||||
}
|
||||
}
|
||||
|
||||
public class SyntaxError {
|
||||
public string Message { get; private set; }
|
||||
public string? File { get; set; }
|
||||
public string? Line { get; set; }
|
||||
public string? Column { get; set; }
|
||||
|
||||
public SyntaxError(string message) {
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
13
HaWeb/Models/SyntaxErrorModel.cs
Normal file
13
HaWeb/Models/SyntaxErrorModel.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace HaWeb.Models;
|
||||
|
||||
public class SyntaxError {
|
||||
public string Message { get; private set; }
|
||||
public int? Line { get; set; }
|
||||
public int? Column { get; set; }
|
||||
|
||||
public SyntaxError(int? line, int? column, string message) {
|
||||
Line = line;
|
||||
Column = column;
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,9 @@ public class XMLStateViewModel {
|
||||
// Verfügbare (Gesamt-)Dateien
|
||||
public List<IFileInfo>? HamannFiles { get; set; }
|
||||
|
||||
// Syntax-Check-Resultate
|
||||
public Dictionary<string, SyntaxCheckModel>? SyntaxCheck { get; set; }
|
||||
|
||||
public XMLStateViewModel(
|
||||
string title,
|
||||
(DateTime PullTime, string Hash)? gitData,
|
||||
|
||||
Reference in New Issue
Block a user