尝试使用源生成器规范NodeModel代码逻辑

This commit is contained in:
fengjiayi
2024-10-20 12:10:57 +08:00
parent 9931fa7436
commit e38833a58c
127 changed files with 5173 additions and 1839 deletions

View File

@@ -49,12 +49,12 @@ namespace Serein.Workbench
// 异步写入日志到文件
// Task.Run(() => File.AppendAllText("log.txt", text));
FlushLog();
// 如果日志达到阈值,立即刷新
if (logBuffer.Length > flushThreshold)
{
FlushLog();
}
//if (logBuffer.Length > flushThreshold)
//{
// FlushLog();
//}
}
}
@@ -75,7 +75,11 @@ namespace Serein.Workbench
: logBuffer.ToString();
logBuffer.Remove(0, logContent.Length); // 清空已更新的部分
LogTextBox.AppendText(logContent);
LogTextBox.Dispatcher.Invoke(() =>
{
LogTextBox.AppendText(logContent);
});
}
// 不必每次都修剪日志当行数超过限制20%时再修剪