-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml.cs
46 lines (41 loc) · 1.27 KB
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using Hardcodet.Wpf.TaskbarNotification;
using System.Windows.Interop;
using System.Runtime.InteropServices;
using System.Timers;
namespace Worksly
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
private Hardcodet.Wpf.TaskbarNotification.TaskbarIcon tb;
public static TimerPlus timer = new TimerPlus();
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
//initialize NotifyIcon
tb = (Hardcodet.Wpf.TaskbarNotification.TaskbarIcon)FindResource("MyTaskBarIcon");
#if DEBUG
tb.ToolTipText = "Worksly Testing";
#endif
timer.Elapsed += new ElapsedEventHandler(HelperTags.Timer_Elapsed);
timer.AutoReset = false;
HelperTags.Schedule_Timer(timer);
}
protected override void OnExit(ExitEventArgs e)
{
tb.Dispose(); //the icon would clean up automatically, but this is cleaner
timer.Dispose();
base.OnExit(e);
}
}
}