Export() public method

Exports the database to a JSON file readable by the javascript web page that will help browsing the textures
public Export ( FileInfo _FileName ) : void
_FileName System.IO.FileInfo
return void
Ejemplo n.º 1
0
        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);
            }
        }