private PackageTreeItem FindOrCreateFolderItemByFolderName(PackageTreeItem parent, string folderName, string relativePath)
        {
            if (parent.hasChildren)
            {
                foreach (PackageTreeItem item in parent.children)
                {
                    if (item.bundleItem.isFolder && item.bundleItem.displayName == folderName)
                    {
                        return(item);
                    }
                }
            }
            PackageTreeItem folderItem = new PackageTreeItem()
            {
                lost       = true,
                id         = --folderID,
                package    = parent.package,
                bundleItem = new BundleTreeItem()
                {
                    displayName  = folderName,
                    icon         = G.g.bundleTree.folderIcon,
                    isFolder     = true,
                    relativePath = relativePath
                }
            };

            parent.AddChild(folderItem);
            return(folderItem);
        }
        private void FindOrCreateBundleItemByBundleName(PackageTreeItem parent, string bundleName, string relativePath)
        {
            if (parent.hasChildren)
            {
                foreach (PackageTreeItem item in parent.children)
                {
                    if (item.bundleItem.displayName == bundleName)
                    {
                        return;
                    }
                }
            }
            var newBundle = new PackageTreeItem()
            {
                lost       = true,
                id         = ++bundleID,
                package    = parent.package,
                bundleItem = new BundleTreeItem()
                {
                    icon         = G.g.bundleTree.bundleIcon,
                    displayName  = bundleName,
                    relativePath = relativePath
                }
            };

            parent.AddChild(newBundle);
        }
        /// <summary>
        /// 从任意一个packageItem节点的第一层children中找到包含bundleItem内容的packageItem,若没有则创建一个
        /// </summary>
        /// <param name="bundleItem">要找的内容</param>
        /// <param name="parent">在该parent节点的第一层子节点中查找</param>
        /// <param name="packageItem">要添加到bundleItem中的包信息</param>
        /// <returns></returns>
        private PackageTreeItem FindOrCreatePackageItem(BundleTreeItem bundleItem, PackageTreeItem parent, PackageTreeItem packageItem)
        {
            PackageTreeItem child = null;

            if (parent.hasChildren)
            {
                foreach (PackageTreeItem c in parent.children)
                {
                    if (c.bundleItem == bundleItem)
                    {
                        child = c;
                        break;
                    }
                }
            }
            if (child == null)
            {
                child = new PackageTreeItem()
                {
                    bundleItem = bundleItem,
                    id         = bundleItem.isFolder ? --folderID : ++bundleID,
                    package    = packageItem,
                    complete   = bundleItem.hasChildren ? false : true
                };
                if (!child.bundleItem.packageItems.Exists(x => x.package == packageItem))
                {
                    child.bundleItem.packageItems.Add(child);
                }
                if (child.bundleItem.isFolder)
                {
                    folderCount++;
                }
                else
                {
                    bundleCount++;
                }

                parent.AddChild(child);

                RecursiveUpdateParentComplete(parent);
            }
            return(child);
        }