Start upgrading to .NET 7

This commit is contained in:
2023-05-01 20:45:23 -04:00
parent 7be7af5980
commit 5610542ce9
27 changed files with 1221 additions and 1420 deletions

View File

@@ -1,42 +1,41 @@
using FloatingStatusWindowLibrary;
using ChrisKaczor.Wpf.FloatingStatusWindow;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using Settings = TestWindow.Properties.Settings;
namespace TestWindow
namespace TestWindow;
public partial class App
{
public partial class App
private List<IDisposable> _windowSourceList;
protected override void OnStartup(StartupEventArgs e)
{
private List<IDisposable> _windowSourceList;
base.OnStartup(e);
protected override void OnStartup(StartupEventArgs e)
StartManager.ManageAutoStart = true;
StartManager.AutoStartEnabled = !Debugger.IsAttached && Settings.Default.AutoStart;
StartManager.AutoStartChanged += (value =>
{
base.OnStartup(e);
Settings.Default.AutoStart = value;
Settings.Default.Save();
});
StartManager.ManageAutoStart = true;
StartManager.AutoStartEnabled = !Debugger.IsAttached && Settings.Default.AutoStart;
StartManager.AutoStartChanged += (value =>
{
Settings.Default.AutoStart = value;
Settings.Default.Save();
});
_windowSourceList = new List<IDisposable>
{
new WindowSource1(),
new WindowSource2(),
new WindowSource3(),
new WindowSource4()
};
}
protected override void OnExit(ExitEventArgs e)
_windowSourceList = new List<IDisposable>
{
_windowSourceList.ForEach(ws => ws.Dispose());
base.OnExit(e);
}
new WindowSource1(),
new WindowSource2(),
new WindowSource3(),
new WindowSource4()
};
}
}
protected override void OnExit(ExitEventArgs e)
{
_windowSourceList.ForEach(ws => ws.Dispose());
base.OnExit(e);
}
}