Skip to content

Commit

Permalink
sort schema elements and types
Browse files Browse the repository at this point in the history
  • Loading branch information
bluepilledgreat committed Oct 20, 2024
1 parent 70b7a65 commit 2d37db1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Bloxstrap/UI/Elements/Editor/BootstrapperEditorWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ public class Type
/// <summary>
/// Elements and their attributes
/// </summary>
public static Dictionary<string, Dictionary<string, string>> ElementInfo { get; set; } = new();
public static SortedDictionary<string, SortedDictionary<string, string>> ElementInfo { get; set; } = new();

/// <summary>
/// All type info
/// </summary>
public static Dictionary<string, Type> Types { get; set; } = new();
public static SortedDictionary<string, Type> Types { get; set; } = new();

public static void ParseSchema()
{
Expand All @@ -57,16 +57,18 @@ public static void ParseSchema()
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<string, string> GetElementAttributes(string name, Element element)
private static SortedDictionary<string, string> GetElementAttributes(string name, Element element)
{
if (ElementInfo.ContainsKey(name))
return ElementInfo[name];

Dictionary<string, string> attributes = new();
SortedDictionary<string, string> attributes = new();

foreach (var attribute in element.Attributes)
attributes.Add(attribute.Key, attribute.Value);
Expand Down

0 comments on commit 2d37db1

Please sign in to comment.