private void LoadLanguages(IAsyncGSL gsl) { if (InvokeRequired) { Invoke(SafeLoadLanguages, new object[] { gsl }); } else { cmbLocale.Items.Clear(); cmbLocale.Enabled = gsl.isDone; if (gsl.isDone) { cmbLocale.Items.AddRange(gsl.languages); cmbLocale.SelectedItem = cmbLocale.Items .Cast <LanguageItem>() .FirstOrDefault(item => item.data == Properties.Settings.Default.targetLocale); } else { cmbLocale.SelectedText = Properties.Settings.Default.targetLocale; } } }
// This setting needs to be split across each translation data source. // Some re-engineering may be involved. private void btnRefreshGSL_Click(object sender, EventArgs e) { gsl = AsyncStatic.MakeGSL(LoadLanguages); }