This commit is contained in:
Zel
2025-02-23 18:47:21 +08:00
parent eaaffeeccb
commit e46a7ca31c
104 changed files with 2630 additions and 2516 deletions

View File

@@ -2,8 +2,14 @@
{
public class BGFGStyle
{
public string ForegroundStyle { get; set; } = String.Empty;
public string BackgroundStyle { get; set; } = String.Empty;
public BGFGStyle()
{
ForegroundStyle = string.Empty;
BackgroundStyle = string.Empty;
}
public string ForegroundStyle { get; set; }
public string BackgroundStyle { get; set; }
public BGFGStyle(string foregroundStyle, string backgroundStyle)
{
@@ -16,9 +22,6 @@
return new BGFGStyle(BackgroundStyle, ForegroundStyle);
}
public BGFGStyle()
{
}
public static readonly Dictionary<string, BGFGStyle> ForegroundStyles = new(StringComparer.OrdinalIgnoreCase)
{
@@ -67,4 +70,4 @@
return new BGFGStyle();
}
}
}
}

View File

@@ -5,7 +5,7 @@ namespace ZelWiki.Engine.Implementation.Utility
public static class Differentiator
{
/// <summary>
/// This leaves a lot to be desired.
///
/// </summary>
/// <param name="thisRev"></param>
/// <param name="prevRev"></param>
@@ -16,35 +16,35 @@ namespace ZelWiki.Engine.Implementation.Utility
var thisRevLines = thisRev.Split('\n');
var prevRevLines = prevRev.Split('\n');
int thisRevLineCount = thisRevLines.Length;
int prevRevLinesCount = prevRevLines.Length;
var thisRevLineCount = thisRevLines.Length;
var prevRevLinesCount = prevRevLines.Length;
int linesAdded = prevRevLines.Except(thisRevLines).Count();
int linesDeleted = thisRevLines.Except(prevRevLines).Count();
var linesAdded = prevRevLines.Except(thisRevLines).Count();
var linesDeleted = thisRevLines.Except(prevRevLines).Count();
if (thisRevLineCount != prevRevLinesCount)
{
summary.Append($"{Math.Abs(thisRevLineCount - prevRevLinesCount):N0} lines changed.");
summary.Append($"{Math.Abs(thisRevLineCount - prevRevLinesCount):N0} 行修改.");
}
if (linesAdded > 0)
{
if (summary.Length > 0) summary.Append(' ');
summary.Append($"{linesAdded:N0} lines added.");
summary.Append($"{linesAdded:N0} 行新增.");
}
if (linesDeleted > 0)
{
if (summary.Length > 0) summary.Append(' ');
summary.Append($"{linesDeleted:N0} lines deleted.");
summary.Append($"{linesDeleted:N0} 行删除.");
}
if (summary.Length == 0)
{
summary.Append($"No changes detected.");
summary.Append($"未修改.");
}
return summary.ToString();
}
}
}
}

View File

@@ -16,10 +16,10 @@ namespace ZelWiki.Engine.Implementation.Utility
pages = pages.Take((int)maxCount).ToList();
}
int pageCount = pages.Count;
int fontSize = 7;
int sizeStep = (pageCount > fontSize ? pageCount : (fontSize * 2)) / fontSize;
int pageIndex = 0;
var pageCount = pages.Count;
var fontSize = 7;
var sizeStep = (pageCount > fontSize ? pageCount : (fontSize * 2)) / fontSize;
var pageIndex = 0;
var pageList = new List<TagCloudItem>();

View File

@@ -17,10 +17,10 @@ namespace ZelWiki.Engine.Implementation.Utility
tags = tags.Take((int)maxCount).ToList();
}
int tagCount = tags.Count;
int fontSize = 7;
int sizeStep = (tagCount > fontSize ? tagCount : (fontSize * 2)) / fontSize;
int tagIndex = 0;
var tagCount = tags.Count;
var fontSize = 7;
var sizeStep = (tagCount > fontSize ? tagCount : (fontSize * 2)) / fontSize;
var tagIndex = 0;
var tagList = new List<TagCloudItem>();