From 56fa51df8baa04bd9dc7504301c2075fd3ddc664 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sun, 20 Oct 2024 22:02:53 +0100 Subject: [PATCH] add fake BloxstrapCustomBootstrapper --- Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs index 9a339e0..d47e109 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs +++ b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs @@ -29,6 +29,7 @@ namespace Bloxstrap.UI.Elements.Bootstrapper private static Dictionary _elementHandlerMap = new Dictionary() { + ["BloxstrapCustomBootstrapper"] = HandleXmlElement_BloxstrapCustomBootstrapper_Fake, ["TitleBar"] = HandleXmlElement_TitleBar, ["Button"] = HandleXmlElement_Button, ["ProgressBar"] = HandleXmlElement_ProgressBar, @@ -503,6 +504,12 @@ namespace Bloxstrap.UI.Elements.Bootstrapper return new DummyFrameworkElement(); } + private static UIElement HandleXmlElement_BloxstrapCustomBootstrapper_Fake(CustomDialog dialog, XElement xmlElement) + { + // this only exists to error out the theme if someone tries to use two BloxstrapCustomBootstrappers + throw new Exception($"{xmlElement.Parent!.Name} cannot have a child of {xmlElement.Name}"); + } + private static DummyFrameworkElement HandleXmlElement_TitleBar(CustomDialog dialog, XElement xmlElement) { xmlElement.SetAttributeValue("Name", "TitleBar"); // prevent two titlebars from existing