mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-02-18 08:56:20 +01:00
Initialize languages list asynchronously
This commit is contained in:
parent
0ea620ffa0
commit
acfb9b2629
@ -6,6 +6,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace DS4Windows.DS4Forms
|
namespace DS4Windows.DS4Forms
|
||||||
@ -76,14 +77,19 @@ namespace DS4Windows.DS4Forms
|
|||||||
public LanguagePackComboBox()
|
public LanguagePackComboBox()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
cbCulture.Enabled = false;
|
||||||
|
|
||||||
// Find available language assemblies and bind the list to the combo box.
|
Task.Run(() => {
|
||||||
cbCulture.DataSource = this.CreateLanguageAssembliesBindingSource();
|
// Find available language assemblies and bind the list to the combo box.
|
||||||
cbCulture.SelectedValue = Thread.CurrentThread.CurrentUICulture.Name;
|
cbCulture.DataSource = this.CreateLanguageAssembliesBindingSource();
|
||||||
|
cbCulture.SelectedValue = Thread.CurrentThread.CurrentUICulture.Name;
|
||||||
|
|
||||||
// This must be set here instead of Designer or event would fire at initial selected value setting above.
|
// This must be set here instead of Designer or event would fire at initial selected value setting above.
|
||||||
cbCulture.SelectedIndexChanged += new EventHandler(CbCulture_SelectedIndexChanged);
|
cbCulture.SelectedIndexChanged += new EventHandler(CbCulture_SelectedIndexChanged);
|
||||||
cbCulture.SelectedValueChanged += new EventHandler(CbCulture_SelectedValueChanged);
|
cbCulture.SelectedValueChanged += new EventHandler(CbCulture_SelectedValueChanged);
|
||||||
|
|
||||||
|
cbCulture.Enabled = true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private BindingSource CreateLanguageAssembliesBindingSource()
|
private BindingSource CreateLanguageAssembliesBindingSource()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user