mirror of
https://github.com/ckaczor/WorldClockStatusWindow.git
synced 2026-01-26 02:45:37 -05:00
Initial code
This commit is contained in:
38
App.xaml.cs
Normal file
38
App.xaml.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using ChrisKaczor.Wpf.Windows.FloatingStatusWindow;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using Settings = WorldClockStatusWindow.Properties.Settings;
|
||||
|
||||
namespace WorldClockStatusWindow;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user