-
-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy pathOptions.xaml.cs
More file actions
67 lines (60 loc) · 1.89 KB
/
Options.xaml.cs
File metadata and controls
67 lines (60 loc) · 1.89 KB
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
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Input;
using BabySmash.Properties;
using MouseEventArgs = System.Windows.Input.MouseEventArgs;
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);
// Get version from assembly
versionLabel.Text = "Version " + (System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "2.0.0");
}
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(new ProcessStartInfo("https://github.com/shanselman/babysmash/issues") { UseShellExecute = true });
}
}
}