- adding Hidden method to ControlBase which will be called on leaving form or on opening a modal one
This commit is contained in:
parent
5126074419
commit
d5a9a5f7a4
@ -51,6 +51,12 @@ namespace TelegramBotBase.Base
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual async Task Hidden(bool FormClose)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task Cleanup()
|
public virtual async Task Cleanup()
|
||||||
|
|||||||
@ -290,6 +290,15 @@ namespace TelegramBotBase.Form
|
|||||||
newForm.Client = this.Client;
|
newForm.Client = this.Client;
|
||||||
newForm.Device = ds;
|
newForm.Device = ds;
|
||||||
|
|
||||||
|
//Notify prior to close
|
||||||
|
foreach (var b in this.Controls)
|
||||||
|
{
|
||||||
|
if (!b.Enabled)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
await b.Hidden(true);
|
||||||
|
}
|
||||||
|
|
||||||
this.CloseControls().Wait();
|
this.CloseControls().Wait();
|
||||||
|
|
||||||
await this.OnClosed(new EventArgs());
|
await this.OnClosed(new EventArgs());
|
||||||
@ -325,6 +334,14 @@ namespace TelegramBotBase.Form
|
|||||||
await CloseModal(newForm, parentForm);
|
await CloseModal(newForm, parentForm);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
foreach (var b in this.Controls)
|
||||||
|
{
|
||||||
|
if (!b.Enabled)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
await b.Hidden(false);
|
||||||
|
}
|
||||||
|
|
||||||
await newForm.OnInit(new InitEventArgs(args));
|
await newForm.OnInit(new InitEventArgs(args));
|
||||||
|
|
||||||
await newForm.OnOpened(new EventArgs());
|
await newForm.OnOpened(new EventArgs());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user