-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.xaml.cs
42 lines (36 loc) · 1.08 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
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using RestoreWindowPlace;
namespace EZCounter
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
///
public partial class App : Application
{
public WindowPlace WindowPlace { get; set; }
public App()
{
string Storage = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "EZCounter");
string placementFile = Path.Combine(Storage, "placement.config");
if(!Directory.Exists(Path.Combine(Storage, "Sounds")))
{
Directory.CreateDirectory(Path.Combine(Storage, "Sounds"));
}
WindowPlace = new WindowPlace(placementFile);
}
protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
WindowPlace.Save();
EZCounter.Properties.Settings.Default.Save();
}
}
}