-
Notifications
You must be signed in to change notification settings - Fork 94
/
Options.xaml.cs
71 lines (64 loc) · 1.96 KB
/
Options.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Deployment.Application;
using System.Diagnostics;
using System.Windows;
using System.Windows.Input;
using BabySmash.Properties;
namespace BabySmash
{
public partial class Options : Window
{
public Options()
{
InitializeComponent();
}
private void OK_Click(object sender, RoutedEventArgs e)
{
Settings.Default.Save();
Close();
}
private void Cancel_Click(object sender, RoutedEventArgs e)
{
Settings.Default.Reload();
Close();
}
protected override void OnActivated(EventArgs e)
{
base.OnActivated(e);
Mouse.Capture(this, CaptureMode.SubTree);
if (ApplicationDeployment.IsNetworkDeployed)
{
versionLabel.Text = "Version " + ApplicationDeployment.CurrentDeployment.CurrentVersion;
}
else
versionLabel.Text = "Version " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
protected override void OnDeactivated(EventArgs e)
{
base.OnDeactivated(e);
Mouse.Capture(null);
}
protected override void OnMouseMove(MouseEventArgs e)
{
//Mouse.Capture(null);
base.OnMouseMove(e);
}
protected override void OnKeyUp(System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Escape)
{
// hitting "escape" is the new cancel button
Settings.Default.Reload();
Close();
}
else
{
base.OnKeyUp(e);
}
}
private void FeedbackLink_Click(object sender, RoutedEventArgs e)
{
Process.Start("http://feedback.babysmash.com");
}
}
}