From c0375f3a47d8f1544d43761385edcc943ac3e6af Mon Sep 17 00:00:00 2001 From: ElektroKill Date: Sat, 18 Dec 2021 14:01:34 +0100 Subject: [PATCH] Enable lazy loading of bundle treeview nodes --- dnSpy/dnSpy/Documents/TreeView/BundleDocumentNodeImpl.cs | 2 +- dnSpy/dnSpy/Documents/TreeView/BundleFolderNodeImpl.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dnSpy/dnSpy/Documents/TreeView/BundleDocumentNodeImpl.cs b/dnSpy/dnSpy/Documents/TreeView/BundleDocumentNodeImpl.cs index 15025f61dd..b1bea49a07 100644 --- a/dnSpy/dnSpy/Documents/TreeView/BundleDocumentNodeImpl.cs +++ b/dnSpy/dnSpy/Documents/TreeView/BundleDocumentNodeImpl.cs @@ -14,8 +14,8 @@ sealed class BundleDocumentNodeImpl : BundleDocumentNode { public BundleDocumentNodeImpl(IDsDocument document) : base(document) { } public override Guid Guid => new Guid(DocumentTreeViewConstants.BUNDLE_NODE_GUID); - protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReference(Document.PEImage!); + public override void Initialize() => TreeNode.LazyLoading = true; public override IEnumerable CreateChildren() { Debug2.Assert(Document.SingleFileBundle is not null); diff --git a/dnSpy/dnSpy/Documents/TreeView/BundleFolderNodeImpl.cs b/dnSpy/dnSpy/Documents/TreeView/BundleFolderNodeImpl.cs index 122b608624..d56accc11a 100644 --- a/dnSpy/dnSpy/Documents/TreeView/BundleFolderNodeImpl.cs +++ b/dnSpy/dnSpy/Documents/TreeView/BundleFolderNodeImpl.cs @@ -13,6 +13,7 @@ sealed class BundleFolderNodeImpl : BundleFolderNode { protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.FolderClosed; protected override ImageReference? GetExpandedIcon(IDotNetImageService dnImgMgr) => DsImages.FolderOpened; public override NodePathName NodePathName => new NodePathName(Guid); + public override void Initialize() => TreeNode.LazyLoading = true; readonly BundleFolder bundleFolder; readonly BundleDocumentNode owner;