-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLogForm.cs
44 lines (38 loc) · 1.12 KB
/
LogForm.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
using OnTopper.Properties;
using System.Globalization;
using System.Threading;
using System.Windows.Forms;
using OnTopper.Util;
namespace OnTopper
{
public partial class LogForm : Form
{
public LogForm()
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Default.LanguageAbbreviation.ToLower());
InitializeComponent();
}
public void ShowDialogWithTopMostState(bool onTop)
{
this.TopMost = onTop;
ShowDialog();
}
public void AddAction(Action action)
{
listBoxActions.Items.Add(action);
}
private void ButtonRevert_Click(object sender, System.EventArgs e)
{
if (listBoxActions.SelectedIndex == -1)
{
return;
}
AddAction((listBoxActions.SelectedItem as Action)?.Revert());
listBoxActions.SelectedIndex = listBoxActions.Items.Count - 1;
}
private void ButtonClear_Click(object sender, System.EventArgs e)
{
listBoxActions.Items.Clear();
}
}
}