19 lines
541 B
C#
19 lines
541 B
C#
using Inspectron.Settings;
|
|
using Ninject;
|
|
|
|
namespace VisionBuilder.UI.Common;
|
|
|
|
public static class Extensions
|
|
{
|
|
public static void RegisterSettings(this IKernel self)
|
|
{
|
|
// get all types from kernel that implement ISettings
|
|
var settingsTypes = self.GetAll(typeof(ISettings)).Select(x=>(ISettings)x).ToList();
|
|
// register each type as ISettings
|
|
foreach (var settingsInstance in settingsTypes)
|
|
{
|
|
settingsInstance.RegisterSettings(self.Get<InspectronSettings>());
|
|
}
|
|
|
|
}
|
|
} |