-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAddComponentForm.cs
41 lines (36 loc) · 969 Bytes
/
AddComponentForm.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
using System;
using System.Linq;
using System.Windows.Forms;
namespace CaravelEditor
{
public partial class AddComponentForm : Form
{
public AddComponentForm(string[] components, string[] entityComponents)
{
InitializeComponent();
addButton.Enabled = false;
foreach (var comp in components)
{
if (!entityComponents.Contains(comp))
{
comboBox.Items.Add(comp);
}
}
}
public string GetSelectedComponent()
{
return (string) comboBox.SelectedItem;
}
public void comboBox_OnSelectedIndexChanged(object sender, EventArgs eventArgs)
{
if (comboBox.SelectedIndex != -1)
{
addButton.Enabled = true;
}
else
{
addButton.Enabled = false;
}
}
}
}