Skip to content

Commit f000ec9

Browse files
committed
Fix remaining compiler warnings across solution
- CS8602: Add null-conditional operators for LogService access - CS0219: Remove unused keyPressed variable in EventCancellationTests - CS8625: Replace null ScrollToControl call with direct ScrollOffset set
1 parent 036a401 commit f000ec9

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

Examples/MultiDashboard/Windows/LogStreamWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private async Task UpdateLoopAsync(Window window, CancellationToken ct)
6464
var level = levels[counter % 4];
6565
var message = _logService.GenerateRandomLog();
6666

67-
_windowSystem.LogService.Log(level, message, "MultiDashboard");
67+
_windowSystem?.LogService?.Log(level, message, "MultiDashboard");
6868

6969
counter++;
7070
await Task.Delay(500, ct);
@@ -75,7 +75,7 @@ private async Task UpdateLoopAsync(Window window, CancellationToken ct)
7575
}
7676
catch (Exception ex)
7777
{
78-
_windowSystem?.LogService.LogError("Log stream error", ex, "LogStream");
78+
_windowSystem?.LogService?.LogError("Log stream error", ex, "LogStream");
7979
}
8080
}
8181
}

SharpConsoleUI.Tests/InputHandling/EventCancellationTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ public void MinimizedWindow_DoesNotReceiveKeyboardInput()
264264

265265
window.Minimize();
266266

267-
bool keyPressed = false;
268-
window.KeyPressed += (s, e) => keyPressed = true;
267+
window.KeyPressed += (s, e) => { };
269268

270269
var keyInfo = new ConsoleKeyInfo('X', ConsoleKey.X, false, false, false);
271270
system.InputStateService.EnqueueKey(keyInfo);

SharpConsoleUI.Tests/InputHandling/ShortcutsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public void Home_ScrollsToTop()
352352
}
353353

354354
system.WindowStateService.AddWindow(window);
355-
window.ScrollToControl(null); // Scroll down
355+
window.ScrollOffset = 20; // Scroll down
356356

357357
var homeKey = new ConsoleKeyInfo('\0', ConsoleKey.Home, false, false, false);
358358
system.InputStateService.EnqueueKey(homeKey);

0 commit comments

Comments
 (0)