From 2d37db126f5876508aeb11a55e4b80ceb1d9556c Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sun, 20 Oct 2024 15:54:07 +0100 Subject: [PATCH] sort schema elements and types --- .../Elements/Editor/BootstrapperEditorWindow.xaml.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Bloxstrap/UI/Elements/Editor/BootstrapperEditorWindow.xaml.cs b/Bloxstrap/UI/Elements/Editor/BootstrapperEditorWindow.xaml.cs index 69623b7..38a2b93 100644 --- a/Bloxstrap/UI/Elements/Editor/BootstrapperEditorWindow.xaml.cs +++ b/Bloxstrap/UI/Elements/Editor/BootstrapperEditorWindow.xaml.cs @@ -41,12 +41,12 @@ namespace Bloxstrap.UI.Elements.Editor /// /// Elements and their attributes /// - public static Dictionary> ElementInfo { get; set; } = new(); + public static SortedDictionary> ElementInfo { get; set; } = new(); /// /// All type info /// - public static Dictionary Types { get; set; } = new(); + public static SortedDictionary Types { get; set; } = new(); public static void ParseSchema() { @@ -57,16 +57,18 @@ namespace Bloxstrap.UI.Elements.Editor if (_schema == null) throw new Exception("Deserialised CustomBootstrapperSchema is null"); - Types = _schema.Types; + foreach (var type in _schema.Types) + Types.Add(type.Key, type.Value); + PopulateElementInfo(); } - private static Dictionary GetElementAttributes(string name, Element element) + private static SortedDictionary GetElementAttributes(string name, Element element) { if (ElementInfo.ContainsKey(name)) return ElementInfo[name]; - Dictionary attributes = new(); + SortedDictionary attributes = new(); foreach (var attribute in element.Attributes) attributes.Add(attribute.Key, attribute.Value);