private void storeAllTranslations() { if (CheckDatabase()) { try { setToolbarStatusText(Resources.StoringTranslations); TranslationStorageManager manager = new TranslationStorageManager(); if (!manager.DatabaseExists()) { manager.CreateDatabase(); } manager.Store(CurrentSolution); setToolbarStatusText(Resources.StoringTranslationsCompleted, 4000); } catch { resetToolbarStatusText(); throw; } finally { } } }
private void btnTest_Click(object sender, EventArgs e) { this.btnTest.Enabled = false; try { var store = new TranslationStorageManager(); if (store.DatabaseExists()) { MessageBox.Show(Properties.Resources.TestConnectionSuccess); } else { MessageBox.Show(Properties.Resources.DatabaseNotExists); } } catch (Exception ex) { if (log.IsErrorEnabled) { log.Error("Testing of database connection failed. ", ex); } MessageBox.Show(ex.Message); } this.btnTest.Enabled = true; }