Modernize project

This commit is contained in:
2026-02-27 12:18:46 -05:00
parent eebd23f702
commit 6001954705
36 changed files with 1338 additions and 1239 deletions

View File

@@ -1,48 +1,38 @@
using FloatingStatusWindowLibrary;
using ProcessCpuUsageStatusWindow.Properties;
using Squirrel;
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using ChrisKaczor.Wpf.Windows.FloatingStatusWindow;
using ProcessCpuUsageStatusWindow.Properties;
namespace ProcessCpuUsageStatusWindow
namespace ProcessCpuUsageStatusWindow;
public partial class App
{
public partial class App
private List<IDisposable> _windowSourceList;
protected override void OnStartup(StartupEventArgs e)
{
private WindowSource _windowSource;
base.OnStartup(e);
public static string UpdateUrl = "https://github.com/ckaczor/ProcessCpuUsageStatusWindow";
[STAThread]
public static void Main(string[] args)
StartManager.ManageAutoStart = true;
StartManager.AutoStartEnabled = !Debugger.IsAttached && Settings.Default.AutoStart;
StartManager.AutoStartChanged += (value =>
{
SquirrelAwareApp.HandleEvents(onAppUpdate: version => Common.Settings.Extensions.RestoreSettings());
Settings.Default.AutoStart = value;
Settings.Default.Save();
});
var application = new App();
application.InitializeComponent();
application.Run();
}
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();
};
_windowSource = new WindowSource();
}
protected override void OnExit(ExitEventArgs e)
{
_windowSource.Dispose();
base.OnExit(e);
}
_windowSourceList =
[
new WindowSource()
];
}
}
protected override void OnExit(ExitEventArgs e)
{
_windowSourceList.ForEach(ws => ws.Dispose());
base.OnExit(e);
}
}