-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMainWindow.xaml.cs
50 lines (42 loc) · 1.55 KB
/
MainWindow.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
using System.Windows;
namespace CSGOLyricsConverter
{
public partial class MainWindow : Window
{
private LyricsConverter converter = new LyricsConverter();
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
if (converter.LoadSteamPath())
{
cfgPathBox.Text = converter.GetDefaultConfigPath();
convertFileBtn.IsEnabled = true;
return;
}
browseFileBtn.IsEnabled = false;
convertFileBtn.IsEnabled = false;
MessageBox.Show("Steam is not installed on this machine.", "CSGOLyricsConverter", MessageBoxButton.OK, MessageBoxImage.Error);
}
private void browseFile_click(object sender, RoutedEventArgs e)
{
if (converter.BrowseLyricsFile())
{
fileInput.Text = converter.filePath;
return;
}
MessageBox.Show("Lyrics file path not found!", "CSGOLyricsConverter", MessageBoxButton.OK, MessageBoxImage.Error);
}
private void convertFile_click(object sender, RoutedEventArgs e)
{
if (converter.IsSteamInstalled)
converter.ConvertToLyricsFile(bindKeyBox.Text);
}
private void defaultCfgPath_click(object sender, RoutedEventArgs e)
{
cfgPathBox.Text = converter.GetDefaultConfigPath();
}
}
}