All checks were successful
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 3m10s
- Some nullability updates
37 lines
904 B
C#
37 lines
904 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Windows;
|
|
using ChrisKaczor.Wpf.Windows.FloatingStatusWindow;
|
|
|
|
namespace HardwareMonitorStatusWindow.StatusWindow;
|
|
|
|
public partial class App
|
|
{
|
|
private List<IDisposable>? _windowSourceList;
|
|
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
{
|
|
base.OnStartup(e);
|
|
|
|
StartManager.ManageAutoStart = true;
|
|
StartManager.AutoStartEnabled = !Debugger.IsAttached && Settings.Default.AutoStart;
|
|
StartManager.AutoStartChanged += (value =>
|
|
{
|
|
Settings.Default.AutoStart = value;
|
|
Settings.Default.Save();
|
|
});
|
|
|
|
_windowSourceList =
|
|
[
|
|
new WindowSource()
|
|
];
|
|
}
|
|
|
|
protected override void OnExit(ExitEventArgs e)
|
|
{
|
|
_windowSourceList?.ForEach(ws => ws.Dispose());
|
|
|
|
base.OnExit(e);
|
|
}
|
|
} |