private void buttonExportJSON_Click(object sender, EventArgs e)
{
// string OldFileName = GetRegKey( "JSONDatabaseFileName", Path.Combine( m_ApplicationPath, "Database.json" ) );
// saveFileDialogExportJSON.InitialDirectory = Path.GetFullPath( OldFileName );
// saveFileDialogExportJSON.FileName = Path.GetFileName( OldFileName );
// if ( saveFileDialogExportJSON.ShowDialog( this ) != DialogResult.OK )
// return;
//
// SetRegKey( "JSONDatabaseFileName", saveFileDialogExportJSON.FileName );
try
{
// m_Database.Export( new FileInfo( saveFileDialogExportJSON.FileName ) );
FileInfo Target = new FileInfo(Path.Combine(m_Database.RootPath.FullName, "database.json"));
m_Database.Export(Target);
MessageBox("Success!\r\nJSON file was successfully exported to \"" + Target.FullName + "\"!", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception _e)
{
MessageBox("An error occurred while exporting the database:\n\n", _e);
}
}