mirror of
https://github.com/ckaczor/ProcessCpuUsageStatusWindow.git
synced 2026-01-13 17:23:02 -05:00
Auto start support
This commit is contained in:
13
App.xaml.cs
13
App.xaml.cs
@@ -1,4 +1,7 @@
|
||||
using System.Windows;
|
||||
using FloatingStatusWindowLibrary;
|
||||
using ProcessCpuUsageStatusWindow.Properties;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProcessCpuUsageStatusWindow
|
||||
{
|
||||
@@ -10,6 +13,14 @@ namespace ProcessCpuUsageStatusWindow
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user