-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettingsWindow.xaml.cs
45 lines (41 loc) · 1.39 KB
/
SettingsWindow.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
using System.Windows;
namespace LicenseMe;
public partial class SettingsWindow : Window
{
/// <summary>
/// Loads the Settings-Window with the Values provided by the Settings-Object
/// </summary>
public SettingsWindow()
{
InitializeComponent();
WindowStyle = WindowStyle.ThreeDBorderWindow;
ResizeMode = ResizeMode.NoResize;
GhUsername.Text = Settings.SettingValues.GitHubUser;
GhToken.Text = Settings.SettingValues.GitHubToken;
GhReadmeLink.Text = Settings.SettingValues.ReadmeUrl;
GhPhraseToReplace.Text = Settings.SettingValues.ReplaceInReadme;
}
/// <summary>
/// Saves the Settings
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void SaveSettings(object sender, RoutedEventArgs e)
{
Settings.SettingValues.GitHubUser = GhUsername.Text;
Settings.SettingValues.GitHubToken = GhToken.Text==""?null:GhToken.Text;
Settings.SettingValues.ReadmeUrl = GhReadmeLink.Text;
Settings.SettingValues.ReplaceInReadme = GhPhraseToReplace.Text;
await Settings.SaveSettings();
Close();
}
/// <summary>
/// Closes the Window
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CloseWindow(object sender, RoutedEventArgs e)
{
Close();
}
}