Implemented GetAllSettings generator to render all settings
This commit is contained in:
parent
83cc7644d1
commit
e91d8fe2eb
@ -79,4 +79,9 @@ public partial class Setting : UserControl
|
|||||||
Dock = DockStyle.Top,
|
Dock = DockStyle.Top,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<Task<Setting>> GetAllSettings()
|
||||||
|
{
|
||||||
|
yield return ShowDeepLSettingAsync();
|
||||||
|
}
|
||||||
}
|
}
|
@ -7,8 +7,8 @@ public partial class Settings : UserControl
|
|||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
this.Load += async (sender, args) =>
|
this.Load += async (sender, args) =>
|
||||||
{
|
{
|
||||||
var deepL = await Setting.ShowDeepLSettingAsync();
|
foreach (var setting in Setting.GetAllSettings())
|
||||||
this.panelSettings.Controls.Add(deepL);
|
this.panelSettings.Controls.Add(await setting);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user