- adding OpenModal/CloseModal features to leave a form open and "just" show a prompt and get back
- added new "ModalDialog" class to present modal forms - updating examples for prompt dialog to use the modal feature
This commit is contained in:
@@ -8,7 +8,7 @@ using TelegramBotBase.Base;
|
||||
|
||||
namespace TelegramBotBase.Form
|
||||
{
|
||||
public class ConfirmDialog : FormBase
|
||||
public class ConfirmDialog : ModalDialog
|
||||
{
|
||||
public String Message { get; set; }
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TelegramBotBase.Form
|
||||
{
|
||||
public class ModalDialog : FormBase
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This is a modal only function and does everything to close this form.
|
||||
/// </summary>
|
||||
public async Task CloseForm()
|
||||
{
|
||||
|
||||
await this.CloseControls();
|
||||
|
||||
await this.OnClosed(new EventArgs());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ using TelegramBotBase.Base;
|
||||
|
||||
namespace TelegramBotBase.Form
|
||||
{
|
||||
public class PromptDialog : FormBase
|
||||
public class PromptDialog : ModalDialog
|
||||
{
|
||||
public String Message { get; set; }
|
||||
|
||||
@@ -53,6 +53,8 @@ namespace TelegramBotBase.Form
|
||||
|
||||
|
||||
OnCompleted(new EventArgs());
|
||||
|
||||
await this.CloseForm();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user