- adding Delete Options for Both sides to AutoCleanForm

- general Performance improvements
- Adding MessageReceived Event to DeviceSession, will be called before "message loop"
- AutoCleanForm optimized and clean process added to public function MessageCleanup (so you could call on your own)
- IsGroup for DeviceSession fixed to correct test
- IsChannel added to DeviceSession

Examples:
- SimpleForm (#1) derived now from AutoCleanForm to show deletion mode for both sides
This commit is contained in:
FlorianDahn
2019-05-04 16:32:48 +02:00
parent 3a78a98b9e
commit 4f1eae543d
9 changed files with 144 additions and 54 deletions
+8 -2
View File
@@ -8,12 +8,18 @@ using TelegramBotBase.Form;
namespace TelegramBaseTest.Tests
{
public class SimpleForm : FormBase
public class SimpleForm : AutoCleanForm
{
public SimpleForm()
{
this.DeleteSide = eSide.Both;
this.DeleteMode = eDeleteMode.OnLeavingForm;
}
public override async Task Opened()
{
await this.Device.Send("Hello world! (send 'back' to get back to Start)");
await this.Device.Send("Hello world! (send 'back' to get back to Start)\r\nOr\r\nhi, hello, maybe, bye and ciao");
}
-10
View File
@@ -15,10 +15,6 @@ namespace TelegramBaseTest.Tests
String LastMessage { get; set; }
public override async Task Init(params object[] param)
{
}
public override async Task Opened()
{
@@ -30,12 +26,6 @@ namespace TelegramBaseTest.Tests
await this.Device.Send("Ciao from Form 1");
}
public override async Task Load(MessageResult message)
{
}
public override async Task Action(MessageResult message)
{
-8
View File
@@ -15,10 +15,6 @@ namespace TelegramBaseTest.Tests
public class TestForm2 : FormBase
{
public override async Task Init(params object[] param)
{
}
public override async Task Opened()
{
@@ -30,10 +26,6 @@ namespace TelegramBaseTest.Tests
await this.Device.Send("Ciao from Form 2");
}
public override async Task Load(MessageResult message)
{
}
public override async Task Action(MessageResult message)
{