1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-06-18 11:24:31 +02:00

added a condition to removechildren

This commit is contained in:
Ellpeck 2019-09-17 14:06:10 +02:00
parent e7c7a5bbc2
commit b699333434

View file

@ -178,9 +178,12 @@ namespace MLEM.Ui.Elements {
this.SetAreaDirty();
}
public void RemoveChildren() {
public void RemoveChildren(Func<Element, bool> condition = null) {
for (var i = this.Children.Count - 1; i >= 0; i--) {
this.RemoveChild(this.Children[i]);
var child = this.Children[i];
if (condition == null || condition(child)) {
this.RemoveChild(child);
}
}
}