-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathholy shit
61 lines (55 loc) · 1.79 KB
/
holy shit
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
private void btnTablesEdit_Click(object sender, EventArgs e)
{
frmEdit myFormAdd = new frmEdit(this);
object[] objTemp = new object[cboTables.Items.Count];
cboTables.Items.CopyTo(objTemp, 0);
myFormAdd.ListItems = objTemp;
myFormAdd.Text = "Editing Tables";
myFormAdd.ShowDialog();
if (myFormAdd.ShowDialog() != DialogResult.Cancel)
{
objTemp = myFormAdd.ListItems;
}
foreach (String strTableName in objTemp)
{
if (cboTables.Items.IndexOf(strTableName) < 0)
{
cboTables.Items.Add(strTableName);
dsXMLInput.Tables.Add(strTableName);
dsXMLInput.Tables[dsXMLInput.Tables.Indexof(strTableName)].Rows.Add();
}
}
do
{
Application.DoEvents();
} while (DeleteFromComboBox(objTemp, cboTables, true));
SaveFiles();
InitializeUI();
LoadTableNamesComboBox();
private void DeleteFromComboBox(object[] objTemp, ComboBox cbo, bool bIsTable)
{
bool BRetVal = false;
foreach (strName in cbo.Items)
{
if (!objtemp.Contains(strName))
{
cboItems.Remove(strName)
if(bIsTable)
{
if (dsXMLInput.Tables.Contains(strName))
{
dsXMLInput.Tables.remove(strName);
}
}
else
{
dsXMLInput.Tables[dsXMLInput.Tables.IndexOf(strTableName)].Columns.Remove(strName);
}
private void SaveFile
{
string strFileSpec - txtXMLSourceFile.Text
int iTheLastDot = strFilespec.LastIndexOF(".")
if iTheLastDot >0)
{ strFileSpec = strFileSpec.Substring(0, iTheLastDot) + ".txt";
}
}