Mergess TraditionRules with TextRules. Added tabs for other Text. Some bugs persist see readme

This commit is contained in:
Simon Martens
2022-11-26 23:15:42 +01:00
parent 49c32dcc6a
commit 6370b70e35
21 changed files with 420 additions and 789 deletions

43
HaWeb/Models/Text.cs Normal file
View File

@@ -0,0 +1,43 @@
namespace HaWeb.Models;
using System.Web;
public class Text {
public string Id { get; private set; }
public string Number { get; private set; }
public bool MinWidth { get; private set; }
public string Category { get; private set; }
public string? ParsedText { get; set; }
private string? _Title;
private List<(string, string, string)>? _ParsedMarginals;
public List<(string Page, string Line, string Text)>? ParsedMarginals {
get => _ParsedMarginals;
set {
if (value != null)
_ParsedMarginals = value.Select(x => (
HttpUtility.HtmlEncode(x.Item1),
HttpUtility.HtmlEncode(x.Item2),
x.Item3
)).ToList();
else
_ParsedMarginals = null;
}
}
public string? Title {
get => _Title;
set {
if (!String.IsNullOrWhiteSpace(value)) {
_Title = value;
} else _Title = null;
}
}
public Text(string id, string number, string category, bool minwidth) {
Id = id;
Number = number;
Category = category;
MinWidth = minwidth;
}
}