mirror of
https://github.com/ckaczor/WorldClockStatusWindow.git
synced 2026-01-13 17:23:18 -05:00
38 lines
945 B
C#
38 lines
945 B
C#
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);
|
|
}
|
|
} |