- small additions
This commit is contained in:
parent
4c8b085655
commit
5c69289198
@ -308,6 +308,20 @@ namespace TelegramBotBase.Form
|
|||||||
this.Controls.Add(control);
|
this.Controls.Add(control);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes control from the formular and runs a cleanup on it.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="control"></param>
|
||||||
|
public async void RemoveControl(ControlBase control)
|
||||||
|
{
|
||||||
|
if (!this.Controls.Contains(control))
|
||||||
|
return;
|
||||||
|
|
||||||
|
await control.Cleanup();
|
||||||
|
|
||||||
|
this.Controls.Remove(control);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Cleanup
|
/// Cleanup
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user