public void SaveObjectList(bool warn = true)
{
if (Cameras.Count == 0 && Microphones.Count == 0)
{
if (warn)
MessageBox.Show(LocRm.GetString("NothingToExport"), LocRm.GetString("Error"));
return;
}
bool save = true;
string filename = _currentFileName;
if (warn)
{
using (var saveFileDialog = new SaveFileDialog
{
InitialDirectory = _lastPath,
Filter = "iSpy Files (*.ispy)|*.ispy|XML Files (*.xml)|*.xml"
})
{
save = saveFileDialog.ShowDialog(this) == DialogResult.OK;
filename = saveFileDialog.FileName;
}
}
if (save)
{
if (filename.Trim() != "")
{
SaveObjects(filename);
try
{
var fi = new FileInfo(filename);
_lastPath = fi.DirectoryName;
}
catch
{
}
}
}
}