Dual GB XML Creator - if file already exists, ask before overwriting

This commit is contained in:
adelikat 2014-05-11 19:00:44 +00:00
parent edb90839d0
commit 360c05c2c8
1 changed files with 10 additions and 0 deletions

View File

@ -152,6 +152,16 @@ namespace BizHawk.Client.EmuHawk
{
if (Recalculate())
{
var fileInfo = new FileInfo(textBoxOutputDir.Text);
if (fileInfo.Exists)
{
var result = MessageBox.Show(this, "File already exists, overwrite?", "File exists", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
if (result != DialogResult.OK)
{
return;
}
}
using (var sw = new StreamWriter(textBoxOutputDir.Text))
{
sw.Write(textBoxXML.Text);