mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-30 09:45:32 +00:00
Initial replacement of old repository.
This commit is contained in:
14
HaLive/Models/MenuItem.cs
Normal file
14
HaLive/Models/MenuItem.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HaLive.Models
|
||||
{
|
||||
public abstract class MenuItem
|
||||
{
|
||||
public string FriendlyName { get; set; }
|
||||
public string DefaultRoute { get; set; }
|
||||
public bool Active { get; set; } = false;
|
||||
}
|
||||
}
|
||||
12
HaLive/Models/MenuPageItem.cs
Normal file
12
HaLive/Models/MenuPageItem.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HaLive.Models
|
||||
{
|
||||
public class MenuPageItem : MenuItem
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
12
HaLive/Models/MenuSubMenuItem.cs
Normal file
12
HaLive/Models/MenuSubMenuItem.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HaLive.Models
|
||||
{
|
||||
public class MenuSubMenuItem : MenuItem
|
||||
{
|
||||
public List<MenuPageItem> menuPages { get; set; }
|
||||
}
|
||||
}
|
||||
37
HaLive/Models/SearchResult.cs
Normal file
37
HaLive/Models/SearchResult.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using HaDocument.Models;
|
||||
using HaDocument.Comparers;
|
||||
using HaDocument.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HaLive.Models {
|
||||
public class DocumentSearchResult {
|
||||
public Meta MetaData { get; }
|
||||
public List<DocumentResult> Results { get; }
|
||||
|
||||
public DocumentSearchResult(Meta meta) {
|
||||
MetaData = meta;
|
||||
Results = new List<DocumentResult>(4);
|
||||
}
|
||||
}
|
||||
|
||||
public class DocumentResult {
|
||||
public string PreviewString { get; }
|
||||
public string Page { get; }
|
||||
public string Line { get; }
|
||||
|
||||
public DocumentResult(string previewstring, string page, string line) {
|
||||
PreviewString = previewstring;
|
||||
Page = page;
|
||||
Line = line;
|
||||
}
|
||||
}
|
||||
|
||||
public class LetterComparer : IComparer<DocumentSearchResult>
|
||||
{
|
||||
public int Compare(DocumentSearchResult first, DocumentSearchResult second)
|
||||
{
|
||||
var cmp = new DefaultComparer();
|
||||
return cmp.Compare(first.MetaData, second.MetaData);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user