void saveprojectsettings(string projectName)
{
try
{
string xml = "";
//xml header
xml += "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
xml += "<tables>\n";
//loop to add all tables
for (int x = 0; x < tableControls.Count; x++)
{
//loop to add particular control for a given table
foreach (string str in tableControls[x].controls)
{
xml += "<" + tableControls[x].tablename + ">\n";
xml += "<column>" + str + "</column>\n";
xml += "</" + tableControls[x].tablename + ">\n";
}
}
xml += "</tables>\n";
string path = "";
path = Directory.GetCurrentDirectory() + "\\" + projectName + "\\" + projectName + "\\controls.xml";
File.WriteAllText(path, xml);
MessageBox.Show("saved!");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}