using Inspectron.Settings;
using Ninject;
using VisionBuilder.UI.Common;
using VisionBuilder.UI.Common.Plugins;

namespace PackstrasseBarcodeReader;

public class Plugin : IPlugin
{
    public void RegisterGlobalModules(IKernel kernel)
    {
        TypeConverterRegistry.Register<List<BarcodeRecipeMapping>>(new ListBarcodeRecipeMappingConverter());
    }

    public void RegisterCameraModules(IKernel kernel, string cameraName)
    {
        kernel.Bind<PackstrasseBarcodeReaderSettings, ISettings>()
            .ToConstant(new PackstrasseBarcodeReaderSettings(cameraName));
        kernel.RegisterModule<PackstrasseBarcodeReaderModule>();
    }
}