Update LibreHardwareMonitor
All checks were successful
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 3m10s
All checks were successful
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 3m10s
- Some nullability updates
This commit is contained in:
@@ -6,15 +6,16 @@ using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Serilog;
|
||||
|
||||
namespace HardwareMonitorStatusWindow.StatusWindow;
|
||||
|
||||
internal static class Data
|
||||
{
|
||||
private static PipeClient<IHardwareMonitorService> _pipeClient;
|
||||
private static IEnumerable<Hardware> _hardware;
|
||||
private static PipeClient<IHardwareMonitorService>? _pipeClient;
|
||||
private static IEnumerable<Hardware>? _hardware;
|
||||
|
||||
internal static ObservableCollection<SensorEntry> SensorEntries { get; set; }
|
||||
internal static ObservableCollection<SensorEntry> SensorEntries { get; set; } = [];
|
||||
|
||||
internal static async Task LoadComputer()
|
||||
{
|
||||
@@ -25,7 +26,7 @@ internal static class Data
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
||||
Log.Error(exception, "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,14 +37,14 @@ internal static class Data
|
||||
|
||||
internal static void CloseComputer()
|
||||
{
|
||||
_pipeClient.Dispose();
|
||||
_pipeClient?.Dispose();
|
||||
}
|
||||
|
||||
internal static IList<Hardware> ComputerHardware => _hardware.ToList();
|
||||
internal static IList<Hardware> ComputerHardware => _hardware?.ToList() ?? [];
|
||||
|
||||
internal static void Load()
|
||||
{
|
||||
SensorEntries = JsonSerializer.Deserialize<ObservableCollection<SensorEntry>>(Settings.Default.Sensors);
|
||||
SensorEntries = JsonSerializer.Deserialize<ObservableCollection<SensorEntry>>(Settings.Default.Sensors) ?? [];
|
||||
}
|
||||
|
||||
internal static void Save()
|
||||
|
||||
Reference in New Issue
Block a user