Implemented GetAllSettings generator to render all settings
This commit is contained in:
2 files changed
+7
-2
No files matched your search
@@ -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);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user