Adding more details on ConfirmDialog
- adding a Tag property for optional use in ArrayPromptDialog and ConfirmDialog - adding it to the ButtonClickedEventArgs
This commit is contained in:
parent
8142b626b2
commit
92f12735c8
@ -16,6 +16,8 @@ namespace TelegramBotBase.Args
|
||||
|
||||
public int Index { get; set; }
|
||||
|
||||
public object Tag { get; set; }
|
||||
|
||||
|
||||
public ButtonClickedEventArgs()
|
||||
{
|
||||
|
||||
@ -16,8 +16,16 @@ namespace TelegramBotBase.Form
|
||||
[IgnoreState]
|
||||
public class ArrayPromptDialog : FormBase
|
||||
{
|
||||
/// <summary>
|
||||
/// The message the users sees.
|
||||
/// </summary>
|
||||
public String Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An additional optional value.
|
||||
/// </summary>
|
||||
public object Tag { get; set; }
|
||||
|
||||
public ButtonBase[][] Buttons { get; set; }
|
||||
|
||||
[Obsolete]
|
||||
@ -70,7 +78,7 @@ namespace TelegramBotBase.Form
|
||||
return;
|
||||
}
|
||||
|
||||
OnButtonClicked(new ButtonClickedEventArgs(button));
|
||||
OnButtonClicked(new ButtonClickedEventArgs(button) { Tag = this.Tag });
|
||||
|
||||
FormBase fb = ButtonForms.ContainsKey(call.Value) ? ButtonForms[call.Value] : null;
|
||||
|
||||
|
||||
@ -13,8 +13,16 @@ namespace TelegramBotBase.Form
|
||||
[IgnoreState]
|
||||
public class ConfirmDialog : ModalDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// The message the users sees.
|
||||
/// </summary>
|
||||
public String Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An additional optional value.
|
||||
/// </summary>
|
||||
public object Tag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Automatically close form on button click
|
||||
/// </summary>
|
||||
@ -77,7 +85,7 @@ namespace TelegramBotBase.Form
|
||||
return;
|
||||
}
|
||||
|
||||
OnButtonClicked(new ButtonClickedEventArgs(button));
|
||||
OnButtonClicked(new ButtonClickedEventArgs(button) { Tag = this.Tag });
|
||||
|
||||
if (AutoCloseOnClick)
|
||||
await CloseForm();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user