From 22a14a9554c6118983b1342e504c274a6106e098 Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Sat, 25 May 2013 17:31:41 -0400 Subject: [PATCH] Sorting on NBT File Node contents --- Model/NbtFileDataNode.cs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Model/NbtFileDataNode.cs b/Model/NbtFileDataNode.cs index 3a3cbac..edf10dc 100644 --- a/Model/NbtFileDataNode.cs +++ b/Model/NbtFileDataNode.cs @@ -90,8 +90,6 @@ namespace NBTExplorer.Model get { return !IsExpanded; } } - //private TagNodeCompound _metaRoot; - protected override void ExpandCore () { if (_tree == null) { @@ -99,21 +97,17 @@ namespace NBTExplorer.Model _tree = new NbtTree(); _tree.ReadFrom(file.GetDataInputStream(_compressionType)); - //_metaRoot = new TagNodeCompound(); - if (_tree.Root != null) { - //_metaRoot.Add(_tree.Name, _tree.Root); _container = new CompoundTagContainer(_tree.Root); } } - /*foreach (TagNode tag in _metaRoot.Values) { - TagDataNode node = TagDataNode.CreateFromTag(tag); - if (node != null) - Nodes.Add(node); - }*/ + var list = new SortedList(); + foreach (var item in _tree.Root) { + list.Add(new TagKey(item.Key, item.Value.GetTagType()), item.Value); + } - foreach (TagNode tag in _tree.Root.Values) { + foreach (TagNode tag in list.Values) { TagDataNode node = TagDataNode.CreateFromTag(tag); if (node != null) Nodes.Add(node);