-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenameEntityForm.cs
43 lines (35 loc) · 1.01 KB
/
RenameEntityForm.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
using System;
using System.Linq;
using System.Windows.Forms;
namespace CaravelEditor
{
public partial class RenameEntityForm : Form
{
public string m_ParentPath;
public string[] m_EntityPaths;
public RenameEntityForm(string entityName, string parentPath, string[] entityPaths)
{
InitializeComponent();
m_EntityPaths = entityPaths;
nameTextBox.Text = entityName;
m_ParentPath = parentPath;
renameButton.Enabled = false;
}
public string GetNewName()
{
return nameTextBox.Text;
}
private void NameChanged(object sender, EventArgs e)
{
TextBox textBox = (TextBox)sender;
if (!m_EntityPaths.Contains(m_ParentPath + "/" + textBox.Text) && textBox.Text != "")
{
renameButton.Enabled = true;
}
else
{
renameButton.Enabled = false;
}
}
}
}