using Processor; namespace UI_WinForms.Components; public partial class Settings : UserControl { public Settings() { this.InitializeComponent(); this.Load += async (sender, args) => await this.LoadAllSettings(); } private async Task LoadAllSettings() { this.panelSettings.Controls.Clear(); foreach (var setting in Setting.GetAllSettings()) this.panelSettings.Controls.Add(await setting); } private async void buttonAddCulture_Click(object sender, EventArgs e) { // Get the current indices of cultures: var cultureIndices = await AppSettings.GetCultureIndices(); // Add a new culture: await AppSettings.SetCultureCode(cultureIndices.Max() + 1, string.Empty); // Reload all settings: await this.LoadAllSettings(); } }