-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfigPicker.cs
47 lines (41 loc) · 1.04 KB
/
ConfigPicker.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
using System;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using DarkUI.Config;
using DarkUI.Controls;
using DarkUI.Forms;
using Kawa.Configuration;
using Kawa.Mix;
using Microsoft.Win32;
namespace KiSSLab
{
public partial class ConfigPicker : DarkDialog
{
public string Choice;
public ConfigPicker(string[] configs)
{
InitializeComponent();
Choice = configs[0]; //default
foreach (var config in configs)
{
list.Items.Add(new DarkListItem() { Text = config });
}
list.SelectItem(0);
//list.Items.AddRange(configs);
//list.SelectedIndex = 0;
//list.Click += (s, e) => { Choice = list.SelectedItem.ToString(); };
//list.DoubleClick += (s, e) => { Choice = list.SelectedItem.ToString(); Close(); };
}
private void list_SelectedIndicesChanged(object sender, EventArgs e)
{
Choice = list.Items[list.SelectedIndices[0]].Text;
}
private void list_DoubleClick(object sender, EventArgs e)
{
Choice = list.Items[list.SelectedIndices[0]].Text;
Close();
}
}
}