Adding LambdaStartFormFactory
This commit is contained in:
parent
e1d5051288
commit
b001d5e9c4
24
TelegramBotBase/Factories/LambdaStartFormFactory.cs
Normal file
24
TelegramBotBase/Factories/LambdaStartFormFactory.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using TelegramBotBase.Form;
|
||||||
|
|
||||||
|
namespace TelegramBotBase.Factories
|
||||||
|
{
|
||||||
|
public class LambdaStartFormFactory : Interfaces.IStartFormFactory
|
||||||
|
{
|
||||||
|
public delegate FormBase CreateFormDelegate();
|
||||||
|
|
||||||
|
private readonly CreateFormDelegate _lambda;
|
||||||
|
|
||||||
|
public LambdaStartFormFactory(CreateFormDelegate lambda)
|
||||||
|
{
|
||||||
|
_lambda = lambda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormBase CreateForm()
|
||||||
|
{
|
||||||
|
return _lambda();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user