2021-09-02 17:47:55 +00:00
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Windows;
|
2021-08-13 23:20:38 +00:00
|
|
|
|
using Hardcodet.Wpf.TaskbarNotification;
|
2021-08-19 20:00:25 +00:00
|
|
|
|
|
2021-08-08 15:12:36 +00:00
|
|
|
|
namespace unison
|
|
|
|
|
{
|
|
|
|
|
public partial class App : Application
|
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
private TaskbarIcon _systray;
|
|
|
|
|
private HotkeyHandler _hotkeys;
|
|
|
|
|
private SnapcastHandler _snapcast;
|
|
|
|
|
private MPDHandler _mpd;
|
2021-08-13 23:20:38 +00:00
|
|
|
|
|
|
|
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
|
|
|
{
|
2021-09-02 17:47:55 +00:00
|
|
|
|
//debug language
|
|
|
|
|
//unison.Resources.Resources.Culture = CultureInfo.GetCultureInfo("fr-FR");
|
|
|
|
|
|
2021-08-13 23:20:38 +00:00
|
|
|
|
base.OnStartup(e);
|
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
_mpd = new MPDHandler();
|
|
|
|
|
Current.Properties["mpd"] = _mpd;
|
2021-08-16 00:13:47 +00:00
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
_hotkeys = new HotkeyHandler();
|
|
|
|
|
Current.Properties["hotkeys"] = _hotkeys;
|
2021-08-19 20:00:25 +00:00
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
_snapcast = new SnapcastHandler();
|
|
|
|
|
Current.Properties["snapcast"] = _snapcast;
|
2021-08-30 23:30:00 +00:00
|
|
|
|
|
2021-08-13 23:20:38 +00:00
|
|
|
|
Current.MainWindow = new MainWindow();
|
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
_systray = (TaskbarIcon)FindResource("SystrayTaskbar");
|
|
|
|
|
Current.Properties["systray"] = _systray;
|
2021-08-13 23:20:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnExit(ExitEventArgs e)
|
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
_systray.Dispose();
|
|
|
|
|
_snapcast.LaunchOrExit(true);
|
|
|
|
|
_hotkeys.RemoveHotKeys();
|
2021-08-13 23:20:38 +00:00
|
|
|
|
base.OnExit(e);
|
|
|
|
|
}
|
2021-08-08 15:12:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|