count descendants and increase element cap

This commit is contained in:
bluepilledgreat 2024-10-20 02:10:58 +01:00
parent 61f8235a74
commit 23e1b2d737

View File

@ -14,7 +14,7 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
{ {
public partial class CustomDialog public partial class CustomDialog
{ {
private const int MaxElements = 50; private const int MaxElements = 100;
private static ThicknessConverter? _thicknessConverter = null; private static ThicknessConverter? _thicknessConverter = null;
private static ThicknessConverter ThicknessConverter { get => _thicknessConverter ??= new ThicknessConverter(); } private static ThicknessConverter ThicknessConverter { get => _thicknessConverter ??= new ThicknessConverter(); }
@ -691,7 +691,7 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
if (xml.Attribute("Version")?.Value != "0") if (xml.Attribute("Version")?.Value != "0")
throw new Exception("Unknown BloxstrapCustomBootstrapper version"); throw new Exception("Unknown BloxstrapCustomBootstrapper version");
if (xml.Elements().Count() > MaxElements) if (xml.Descendants().Count() > MaxElements)
throw new Exception($"Custom bootstrappers can have a maximum of {MaxElements} elements"); throw new Exception($"Custom bootstrappers can have a maximum of {MaxElements} elements");
_initialised = true; _initialised = true;