mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 09:15:33 +00:00
Added marginal search. Some refactoring
This commit is contained in:
@@ -8,27 +8,37 @@ public enum SearchResultType {
|
||||
InvalidSearchTerm
|
||||
}
|
||||
|
||||
public enum SearchType {
|
||||
Letters,
|
||||
Register,
|
||||
Science
|
||||
}
|
||||
|
||||
public class SucheViewModel {
|
||||
public List<(int Year, List<BriefeMetaViewModel> LetterList)>? Letters { get; private set; }
|
||||
public List<CommentModel>? Comments { get; private set; }
|
||||
public Dictionary<string, List<(Marginal, string)>>? Marginals { get; private set; }
|
||||
|
||||
public int Count { get; private set; }
|
||||
public int ActivePage { get; private set; }
|
||||
public List<string>? AvailablePages { get; private set; }
|
||||
public bool? IncludeComments { get; private set; }
|
||||
public string ActiveSearch { get; private set; }
|
||||
public List<string>? AvailablePages { get; private set; }
|
||||
public Dictionary<string, List<SearchResult>>? SearchResults { get; private set; }
|
||||
public SearchResultType SearchResultType { get; private set; }
|
||||
public string SearchType { get; private set; }
|
||||
public SearchType SearchType { get; private set; }
|
||||
|
||||
public SucheViewModel(
|
||||
string searchType,
|
||||
SearchType searchType,
|
||||
SearchResultType searchResultType,
|
||||
bool? includeComments,
|
||||
int activePage,
|
||||
List<string>? availablePages,
|
||||
string activeSearch,
|
||||
Dictionary<string, List<SearchResult>>? searchResults,
|
||||
List<(int Year, List<BriefeMetaViewModel> LetterList)>? letters,
|
||||
List<CommentModel>? comments
|
||||
List<CommentModel>? comments,
|
||||
Dictionary<string, List<(Marginal, string)>>? marginals
|
||||
) {
|
||||
Letters = letters;
|
||||
if (letters != null)
|
||||
@@ -43,5 +53,7 @@ public class SucheViewModel {
|
||||
ActiveSearch = activeSearch;
|
||||
SearchResults = searchResults;
|
||||
Comments = comments;
|
||||
Marginals = marginals;
|
||||
IncludeComments = includeComments;
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public class XMLRootDocument {
|
||||
}
|
||||
|
||||
private string _removeInvalidChars(string? s) {
|
||||
if (String.IsNullOrWhiteSpace(s)) return "";
|
||||
if (String.IsNullOrWhiteSpace(s)) return string.Empty;
|
||||
foreach (var c in Path.GetInvalidFileNameChars()) {
|
||||
s = s.Replace(c, '-');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user