Implemented GetAllSettings generator to render all settings

This commit is contained in:
Thorsten Sommer 2022-07-26 19:45:18 +02:00
parent 83cc7644d1
commit e91d8fe2eb
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 7 additions and 2 deletions

View File

@ -79,4 +79,9 @@ public partial class Setting : UserControl
Dock = DockStyle.Top,
};
}
public static IEnumerable<Task<Setting>> GetAllSettings()
{
yield return ShowDeepLSettingAsync();
}
}

View File

@ -7,8 +7,8 @@ public partial class Settings : UserControl
this.InitializeComponent();
this.Load += async (sender, args) =>
{
var deepL = await Setting.ShowDeepLSettingAsync();
this.panelSettings.Controls.Add(deepL);
foreach (var setting in Setting.GetAllSettings())
this.panelSettings.Controls.Add(await setting);
};
}
}