mirror of
https://github.com/ckaczor/FloatingStatusWindow.git
synced 2026-01-14 01:25:36 -05:00
Start upgrading to .NET 7
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user