-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathProcessEdit.cs
42 lines (34 loc) · 1.18 KB
/
ProcessEdit.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
using System;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Windows.Forms;
namespace NVStreamer1080 {
public partial class ProcessEdit : Form {
public ProcessEdit(AutoAction item) {
Item = item;
InitializeComponent();
RefreshProcs_Click(null, null);
}
readonly AutoAction Item = null;
private void BtnConfirm_Click(object sender, EventArgs e) {
Close();
}
private void ProcName_TextChanged(object sender, EventArgs e) {
Item.Process=ProcName.Text;
}
private void RefreshProcs_Click(object sender, EventArgs e) {
Processes.Items.Clear();
Processes.Items.AddRange(Process.GetProcesses().Select(a => a.ProcessName).ToArray());
}
private void Processes_DoubleClick(object sender, EventArgs e) {
if (Processes.SelectedItem!=null) {
ProcName.Text = (string)Processes.SelectedItem;
Item.Process = ProcName.Text;
}
}
private void ProcessEdit_Load(object sender, EventArgs e) {
ProcName.Text=Item.Process;
}
}
}