add fake BloxstrapCustomBootstrapper

This commit is contained in:
bluepilledgreat 2024-10-20 22:02:53 +01:00
parent fb7e14bf64
commit 56fa51df8b

View File

@ -29,6 +29,7 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
private static Dictionary<string, HandleXmlElementDelegate> _elementHandlerMap = new Dictionary<string, HandleXmlElementDelegate>()
{
["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