forked from mirrors/NBTExplorer
Merge pull request #32 from codewarrior0/open-unknown-as-nbt
When opening files directly, try opening as NBT if no registered filetypes were able to open them.
This commit is contained in:
commit
5d456cf743
1 changed files with 8 additions and 6 deletions
|
@ -229,12 +229,14 @@ namespace NBTExplorer.Controllers
|
|||
foreach (var item in FileTypeRegistry.RegisteredTypes) {
|
||||
if (item.Value.NamePatternTest(path))
|
||||
node = item.Value.NodeCreate(path);
|
||||
}
|
||||
|
||||
if (node != null)
|
||||
_nodeTree.Nodes.Add(CreateUnexpandedNode(node));
|
||||
else
|
||||
failCount++;
|
||||
}
|
||||
|
||||
if (node == null)
|
||||
node = NbtFileDataNode.TryCreateFrom(path);
|
||||
if (node != null)
|
||||
_nodeTree.Nodes.Add(CreateUnexpandedNode(node));
|
||||
else
|
||||
failCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue