di and serialization support
build nuget workflow for TelegramBotBase project / Build-TelegramBotBase (x64, linux) (push) Successful in 37s
build nuget workflow for TelegramBotBase project / Build-TelegramBotBase (x64, linux) (push) Successful in 37s
This commit is contained in:
@@ -23,13 +23,15 @@ public class ServiceProviderStartFormFactory : IStartFormFactory
|
||||
_serviceProvider = serviceProvider;
|
||||
}
|
||||
|
||||
public FormBase CreateForm()
|
||||
public FormBase CreateForm() => CreateForm(null);
|
||||
|
||||
public FormBase CreateForm(Type? specifiedStartFrom = null)
|
||||
{
|
||||
FormBase fb = null;
|
||||
|
||||
try
|
||||
{
|
||||
fb = (FormBase)ActivatorUtilities.CreateInstance(_serviceProvider, _startFormClass);
|
||||
fb = (FormBase)ActivatorUtilities.CreateInstance(_serviceProvider, specifiedStartFrom ?? _startFormClass);
|
||||
}
|
||||
catch(InvalidOperationException ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user