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 int Index { get; set; }
|
||||||
|
|
||||||
|
public object Tag { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public ButtonClickedEventArgs()
|
public ButtonClickedEventArgs()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -16,8 +16,16 @@ namespace TelegramBotBase.Form
|
|||||||
[IgnoreState]
|
[IgnoreState]
|
||||||
public class ArrayPromptDialog : FormBase
|
public class ArrayPromptDialog : FormBase
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The message the users sees.
|
||||||
|
/// </summary>
|
||||||
public String Message { get; set; }
|
public String Message { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// An additional optional value.
|
||||||
|
/// </summary>
|
||||||
|
public object Tag { get; set; }
|
||||||
|
|
||||||
public ButtonBase[][] Buttons { get; set; }
|
public ButtonBase[][] Buttons { get; set; }
|
||||||
|
|
||||||
[Obsolete]
|
[Obsolete]
|
||||||
@ -70,7 +78,7 @@ namespace TelegramBotBase.Form
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
OnButtonClicked(new ButtonClickedEventArgs(button));
|
OnButtonClicked(new ButtonClickedEventArgs(button) { Tag = this.Tag });
|
||||||
|
|
||||||
FormBase fb = ButtonForms.ContainsKey(call.Value) ? ButtonForms[call.Value] : null;
|
FormBase fb = ButtonForms.ContainsKey(call.Value) ? ButtonForms[call.Value] : null;
|
||||||
|
|
||||||
|
|||||||
@ -13,8 +13,16 @@ namespace TelegramBotBase.Form
|
|||||||
[IgnoreState]
|
[IgnoreState]
|
||||||
public class ConfirmDialog : ModalDialog
|
public class ConfirmDialog : ModalDialog
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The message the users sees.
|
||||||
|
/// </summary>
|
||||||
public String Message { get; set; }
|
public String Message { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// An additional optional value.
|
||||||
|
/// </summary>
|
||||||
|
public object Tag { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Automatically close form on button click
|
/// Automatically close form on button click
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -77,7 +85,7 @@ namespace TelegramBotBase.Form
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
OnButtonClicked(new ButtonClickedEventArgs(button));
|
OnButtonClicked(new ButtonClickedEventArgs(button) { Tag = this.Tag });
|
||||||
|
|
||||||
if (AutoCloseOnClick)
|
if (AutoCloseOnClick)
|
||||||
await CloseForm();
|
await CloseForm();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user