Adding new constructor and additonal ToRowList method to ButtonForm
This commit is contained in:
parent
c4a589d476
commit
6f930eee8c
@ -23,6 +23,11 @@ public class ButtonForm
|
|||||||
DependencyControl = control;
|
DependencyControl = control;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ButtonForm(IEnumerable<ButtonRow> rows)
|
||||||
|
{
|
||||||
|
_buttons = rows.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public IReplyMarkup Markup { get; set; }
|
public IReplyMarkup Markup { get; set; }
|
||||||
|
|
||||||
@ -149,6 +154,11 @@ public class ButtonForm
|
|||||||
.Aggregate((a, b) => a.Union(b).ToList());
|
.Aggregate((a, b) => a.Union(b).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ButtonRow> ToRowList()
|
||||||
|
{
|
||||||
|
return _buttons;
|
||||||
|
}
|
||||||
|
|
||||||
public InlineKeyboardButton[][] ToInlineButtonArray()
|
public InlineKeyboardButton[][] ToInlineButtonArray()
|
||||||
{
|
{
|
||||||
var ikb = _buttons.Select(a => a.ToArray().Select(b => b.ToInlineButton(this)).ToArray()).ToArray();
|
var ikb = _buttons.Select(a => a.ToArray().Select(b => b.ToInlineButton(this)).ToArray()).ToArray();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user