A lot of stuff related to parsing; index page input validation

This commit is contained in:
Simon Martens
2023-09-17 15:29:51 +02:00
parent d86d508786
commit b15ce8793c
23 changed files with 294 additions and 60 deletions

View File

@@ -6,10 +6,14 @@ using HaDocument.Models;
namespace HaDocument.Comparers {
public class CommentComparer : IComparer<Comment> {
public int Compare(Comment first, Comment second) {
if (first.Order != second.Order)
return first.Order.CompareTo(second.Order);
if (first.Order.HasValue && second.Order.HasValue)
return first.Order.Value.CompareTo(second.Order.Value);
else if (first.Order.HasValue)
return 1;
else if (second.Order.HasValue)
return -1;
else
return first.Index.CompareTo(second.Index);
return 0;
}
}
}