You could try something like this - note that it assumes you can work out what the filename should be...
if (_AllTests.Count > 0)
{
LogMessage(String.Empty);
saveFileDialog1.Filter = "XML files (*.xml)|*.xml";
saveFileDialog1.InitialDirectory = Application.StartupPath + "\\ SavedTest\\";
foreach (Test t in _AllTests)
{
if (t._testName == tabControl2.SelectedTab.Text)
{
DialogResult d = DialogResult.Cancel;
FileInfo fi = new FileInfo(Application.StartupPath + "\\SavedTest\\" + t._testName);
if (fi.Exists())
d = DialogResult.OK;
else
d = saveFileDialog1.ShowDialog
if(d == DialogResult.OK)
{
LogMessage("Saving " + file + "...");
TestToXML(t, file);
LogMessage("Saved Successfully.");
}
}
}
}