-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUI.cs
60 lines (52 loc) · 1.81 KB
/
UI.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
using DARtoOAR.Components;
using NLog;
namespace DARtoOAR
{
public partial class UI : Form
{
private static readonly Logger LOGGER = LogManager.GetCurrentClassLogger();
private static string DEFAULT_FOLDER_PATH = @"c:\Users";
public UI()
{
InitializeComponent();
}
private void UI_Load(object sender, EventArgs e)
{
}
private void darFolderPickerBtn_Click(object sender, EventArgs e)
{
var darFolderDlg = new FolderPicker();
darFolderDlg.InputPath = DEFAULT_FOLDER_PATH;
if (darFolderDlg.ShowDialog(darFolderPickerBtn.Handle) == true)
{
darModFolderPath.Text = darFolderDlg.ResultPath;
}
}
private void oarFolderPickerBtn_Click(object sender, EventArgs e)
{
var oarFolderDlg = new FolderPicker();
oarFolderDlg.InputPath = DEFAULT_FOLDER_PATH;
if (oarFolderDlg.ShowDialog(oarFolderPickerBtn.Handle) == true)
{
oarModFolderPath.Text = oarFolderDlg.ResultPath;
}
}
private void convertBtn_Click(object sender, EventArgs e)
{
try
{
Converter.convertDARtoOAR(darModFolderPath.Text, oarModFolderPath.Text, modName.Text, modAuthor.Text);
MessageBox.Show("Conversion successful!");
}
catch (Exception ex)
{
LOGGER.Error(ex);
}
}
private void darModFolderPath_TextChanged(object sender, EventArgs e)
{
oarModFolderPath.Text = darModFolderPath.Text;
modName.Text = new DirectoryInfo(oarModFolderPath.Text).Name;
}
}
}