- added IsDisposed to form

- removed FormSwitched from FormBase and added to DeviceSession (more logical message loop)
- added PreviousForm to DeviceSession, contains last opened form (at initial form is null)
-BotBase message loop update
- now navigation is possible from every form, not just the latest ones as before
This commit is contained in:
FlorianDahn
2019-06-22 15:15:29 +02:00
parent 022eee4b57
commit fe1aafc9a5
3 changed files with 28 additions and 10 deletions
+6 -4
View File
@@ -20,9 +20,9 @@ namespace TelegramBotBase.Form
public bool CustomEventManagement { get; set; } = false;
/// <summary>
/// contains if the form has been switched (navigated)
/// has this formular already been disposed ?
/// </summary>
public bool FormSwitched { get; set; } = false;
public bool IsDisposed { get; set; } = false;
public List<ControlBase> Controls { get; set; }
@@ -117,12 +117,14 @@ namespace TelegramBotBase.Form
if (ds == null)
return;
this.FormSwitched = true;
ds.FormSwitched = true;
ds.ActiveForm = newForm;
newForm.Client = this.Client;
newForm.Device = ds;
ds.PreviousForm = this;
await newForm.Init(args);
await this.Closed();
@@ -137,7 +139,7 @@ namespace TelegramBotBase.Form
{
this.Client = null;
this.Device = null;
this.FormSwitched = false;
this.IsDisposed = true;
}
}
}