16 lines
279 B
C#
16 lines
279 B
C#
namespace Hyperbar.Widget;
|
|
|
|
public class WidgetFactory :
|
|
IFactory<Type, IWidget>
|
|
{
|
|
public IWidget? Create(Type value)
|
|
{
|
|
if (Activator.CreateInstance(value) is IWidget widget)
|
|
{
|
|
return widget;
|
|
}
|
|
|
|
return default;
|
|
}
|
|
}
|