Remove non-working last line log code

This commit is contained in:
Matt Nadareski
2024-12-18 23:16:14 -05:00
parent e055572c67
commit 7b7e8912a5
2 changed files with 2 additions and 24 deletions

View File

@@ -82,6 +82,7 @@
- Update packages
- Simplify direct package references
- Remove vestigial progress indicators
- Remove non-working last line log code
### 3.2.4 (2024-11-24)

View File

@@ -28,11 +28,6 @@ namespace MPF.UI.UserControls
/// </summary>
private readonly Paragraph _paragraph;
/// <summary>
/// Cached value of the last line written
/// </summary>
private Run? lastLine = null;
#if NET35
private Button? ClearButton => ItemHelper.FindChild<Button>(this, "ClearButton");
@@ -138,10 +133,7 @@ namespace MPF.UI.UserControls
try
{
if (nextText.StartsWith("\r"))
ReplaceLastLine(nextLogLine);
else
AppendToTextBox(nextLogLine);
AppendToTextBox(nextLogLine);
}
catch (Exception ex)
{
@@ -160,21 +152,6 @@ namespace MPF.UI.UserControls
{
var run = logLine.GenerateRun();
_paragraph.Inlines.Add(run);
lastLine = run;
});
}
/// <summary>
/// Replace the last line written to the log text box
/// </summary>
/// <param name="logLine">LogLine value to append</param>
private void ReplaceLastLine(LogLine logLine)
{
Dispatcher.Invoke(() =>
{
lastLine ??= new Run();
lastLine.Text = logLine.Text;
lastLine.Foreground = logLine.GetForegroundColor();
});
}