- 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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user