private void textureTreeView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            NodeType          type           = (NodeType)e.Node.Tag;
            TextureCollection textureManager = textureCollection;

            textureImageList.Images.Clear();

            switch (type)
            {
            case NodeType.Directory:
                if (currentGroupName != e.Node.Name)
                {
                    currentGroupName    = e.Node.Name;
                    lastSelectedTexture = null;
                }
                break;

            case NodeType.Texture:
                TextureItem?texture = textureManager.GetTextureItemById(e.Node.Name);
                if (texture.HasValue)
                {
                    currentGroupName = texture.Value.Group;
                }
                break;
            }

            textureListView.VirtualListSize = textureManager.GetTexturesByGroup(currentGroupName).Count;
        }
        private void textureListView_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            TextureItem?textureItem = textureCollection.GetTextureItemById(e.Item.Name);

            if (textureItem.HasValue)
            {
                lastSelectedTexture = textureItem.Value;
            }
        }
        private void textureListView_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ListView     senderList  = (ListView)sender;
            ListViewItem clickedItem = senderList.HitTest(e.Location).Item;

            if (clickedItem != null)
            {
                TextureCollection textureManager = textureCollection;
                TextureItem?      textureItem    = textureManager.GetTextureItemById(clickedItem.Name);

                if (textureItem.HasValue)
                {
                    textureCollection.SelectedTexture = textureItem.Value;
                    OnTextureSelected?.Invoke(textureItem.Value);
                }
            }
        }