- update readme and formbase
This commit is contained in:
parent
058539777f
commit
d1456d5bd1
20
README.md
20
README.md
@ -688,26 +688,8 @@ No example yet
|
|||||||
|
|
||||||
<img src="images/promptdialog.PNG" />
|
<img src="images/promptdialog.PNG" />
|
||||||
|
|
||||||
#### Without Eventhandler (pre-init of form necessary)
|
|
||||||
|
|
||||||
```
|
#### With Eventhandler
|
||||||
|
|
||||||
PromptDialog pd = new PromptDialog("Please confirm");
|
|
||||||
|
|
||||||
pd.AddButton(new ButtonBase("Ok", "ok"));
|
|
||||||
pd.AddButton(new ButtonBase("Cancel", "cancel"));
|
|
||||||
|
|
||||||
var tf = new TestForm2();
|
|
||||||
|
|
||||||
pd.ButtonForms.Add("ok", tf);
|
|
||||||
pd.ButtonForms.Add("cancel", tf);
|
|
||||||
|
|
||||||
await this.NavigateTo(pd);
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
#### With Eventhandler (no pre-init of form necessary)
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -312,12 +312,12 @@ namespace TelegramBotBase.Form
|
|||||||
/// Removes control from the formular and runs a cleanup on it.
|
/// Removes control from the formular and runs a cleanup on it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="control"></param>
|
/// <param name="control"></param>
|
||||||
public async void RemoveControl(ControlBase control)
|
public void RemoveControl(ControlBase control)
|
||||||
{
|
{
|
||||||
if (!this.Controls.Contains(control))
|
if (!this.Controls.Contains(control))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
await control.Cleanup();
|
control.Cleanup().Wait();
|
||||||
|
|
||||||
this.Controls.Remove(control);
|
this.Controls.Remove(control);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user