- Improvements to system calls

- system calls now async with await
- added start command to example
- added "handled" property to system call event args
This commit is contained in:
FlorianDahn
2019-03-20 16:57:10 +07:00
parent 816bf4cbbe
commit c6666f72bc
4 changed files with 42 additions and 19 deletions
+10 -2
View File
@@ -21,13 +21,19 @@ namespace TelegramBaseTest
bb.SystemCalls.Add("/start");
bb.SystemCalls.Add("/form1");
bb.SystemCalls.Add("/form2");
bb.SystemCalls.Add("/params");
bb.SystemCall += async (s, en) =>
{
switch (en.Command)
{
case "/start":
var start = new Start();
await en.Device.ActiveForm.NavigateTo(start);
break;
case "/form1":
var form1 = new TestForm();
@@ -47,8 +53,10 @@ namespace TelegramBaseTest
case "/params":
String m = en.Parameters.DefaultIfEmpty("").Aggregate((a, b) => a + " and " + b);
await en.Device.Send("Your parameters are: " + m, replyTo: en.Device.LastMessageId);
await en.Device.Send("Your parameters are " + m, replyTo: en.Device.LastMessage);
en.Handled = true;
break;
}