void mDatabaseInstance_OnSchemaError(FFRKMySqlInstance.ConnectResult ConnectResult) { mTabPage.BeginInvoke((Action)(() => MessageBox.Show("FFRK Inspector has been updated. Please download the latest release " + "from https://github.com/cppisking/ffrk-inspector/releases. Database " + "connectivity will be unavailable for the remainder of this session."))); }
void mDatabaseInstance_OnConnectionInitialized(FFRKMySqlInstance.ConnectResult Result) { switch (Result) { case FFRKMySqlInstance.ConnectResult.Success: PopulateDataCache(); break; case FFRKMySqlInstance.ConnectResult.SchemaTooOld: mTabPage.BeginInvoke((Action)(() => MessageBox.Show( "The database you are connected to is for an older version of FFRK " + "Inspector. Please point to a newer database instance. Database " + "connectivity will not be available for this session.", "Database version mismatch"))); break; case FFRKMySqlInstance.ConnectResult.SchemaTooNew: mTabPage.BeginInvoke((Action)(() => MessageBox.Show( "FFRK Inspector is outdated and needs to be updated. Please update " + "to the latest version. Database connectivity will not be available " + "for this session.", "Database version mismatch"))); break; } }
private void buttonTestSettings_Click(object sender, EventArgs e) { FFRKMySqlInstance.ConnectResult result = FFRKMySqlInstance.ConnectResult.InvalidConnection; try { result = FFRKProxy.Instance.Database.TestConnect( textBoxHost.Text, textBoxUser.Text, textBoxPassword.Text, textBoxSchema.Text, FFRKProxy.Instance.MinimumRequiredSchema); switch (result) { case FFRKMySqlInstance.ConnectResult.Success: MessageBox.Show(mConnectionSuccessMsg, "Success"); break; case FFRKMySqlInstance.ConnectResult.InvalidConnection: MessageBox.Show(mInvalidConnectionMsg, "Invalid connection parameters"); break; case FFRKMySqlInstance.ConnectResult.SchemaTooNew: MessageBox.Show(mDatabaseTooNewMsg, "Database too new"); break; case FFRKMySqlInstance.ConnectResult.SchemaTooOld: MessageBox.Show(mDatabaseTooOldMsg, "Database too old"); break; } } catch (MySqlException ex) { MessageBox.Show(String.Format(mInvalidConnectionMsg, ex.Message)); } }