private void buttonChangeDatabaseLocation_Click( object sender, EventArgs e )
{
string OldDatabasePath = GetRegKey( "DatabasePath", m_ApplicationPath );
folderBrowserDialogDatabaseLocation.SelectedPath = OldDatabasePath;
if ( folderBrowserDialogDatabaseLocation.ShowDialog( this ) != DialogResult.OK )
return;
SetRegKey( "DatabasePath", folderBrowserDialogDatabaseLocation.SelectedPath );
try
{
m_Database.RootPath = new DirectoryInfo( folderBrowserDialogDatabaseLocation.SelectedPath );
textBoxDatabaseRootPath.BackColor = m_Database.RootPath.Exists ? BackColor : Color.Red;
textBoxDatabaseRootPath.Text = m_Database.RootPath.FullName;
UpdateDatabaseEntries();
}
catch ( Exception _e )
{
MessageBox( "An error occurred while changing the database location:\n\n", _e );
}
}