These changes offer an alternative way of building factories. It tends to simplify the usage during the initialization/definition phase. Perhaps it's more intuitive? (that's a bit subjective). I tried not to introduce any breaking changes, so any existing code should work, the existing API remains as it is.
For now, it covers only WindowsHidDeviceFactory, and it's provided just as a sample. If this approach is preferred, then it can be extended to include the rest of the components. So, this PR is incomplete
Sample usage:
// Optional
var loggerFactory = LoggerFactory.Create((builder) =>
{
_ = builder.AddDebug().SetMinimumLevel(LogLevel.Trace);
});
var factories = new FactoryBuilder(loggerFactory)
.CreateWindowsHidDeviceFactory(new FilterDeviceDefinition())
.CreateWindowsHidDeviceFactory(new FilterDeviceDefinition[]
{
new FilterDeviceDefinition(),
new FilterDeviceDefinition(),
})
.Build();
Hi,
These changes offer an alternative way of building factories. It tends to simplify the usage during the initialization/definition phase. Perhaps it's more intuitive? (that's a bit subjective). I tried not to introduce any breaking changes, so any existing code should work, the existing API remains as it is.
For now, it covers only
WindowsHidDeviceFactory
, and it's provided just as a sample. If this approach is preferred, then it can be extended to include the rest of the components. So, this PR is incompleteSample usage: