我想在其构造函数中注册一个使用先前注册类型的类,但也有一个需要指定的构造函数参数。
ConnectionEngine 需要使用 new BackgroundWorkerPoll(1000) 创建。我该怎么做呢?
FreshIOC.Container.Register<IFormsDevice, DeviceWrapper>();
FreshIOC.Container.Register<IBluetoothQuery, BluetoothQuery>();
FreshIOC.Container.Register<ISuperConnectionManager, SuperConnectionManager>();
....................
var superConnectionManager = FreshIOC.Container.Resolve<ISuperConnectionManager>();
var bluetoothQuery = FreshIOC.Container.Resolve<IBluetoothQuery>();
var formsDevice = FreshIOC.Container.Resolve<IFormsDevice>();
var connectionEngine = new ConnectionEngine(superConnectionManager,
bluetoothQuery, new BackgroundWorkerPoll(1000), formsDevice);